Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7899665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:45:51+00:00 2026-06-03T08:45:51+00:00

i have GRP tracks on map, which have difficulty from 1 to 10. I

  • 0

i have GRP tracks on map, which have difficulty from 1 to 10. I want these tracks to have different color depending on difficulty. Easy difficulty is green, hard is red and medium is orange. However, i need to have not just these 3 colors but smoother transitions between them. like one color for every point of difficulty or one for every half point. Is there any algorithm to compute these colors and theirs transitions? Like somehow increasing/decreasing rgb values? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:45:53+00:00Added an answer on June 3, 2026 at 8:45 am
    using System;
    using System.Drawing;
    using System.Windows.Forms;
    
    public partial class MainForm : Form
    {
        protected override void OnPaint(PaintEventArgs e)
        {
            Color[] colors = new Color[11];
    
            colors[0] = Color.Green;
            colors[1] = Interpolate(Color.Green, Color.Orange, 0.2);
            colors[2] = Interpolate(Color.Green, Color.Orange, 0.4);
            colors[3] = Interpolate(Color.Green, Color.Orange, 0.6);
            colors[4] = Interpolate(Color.Green, Color.Orange, 0.8);
            colors[5] = Color.Orange;
            colors[6] = Interpolate(Color.Orange, Color.Red, 0.2);
            colors[7] = Interpolate(Color.Orange, Color.Red, 0.4);
            colors[8] = Interpolate(Color.Orange, Color.Red, 0.6);
            colors[9] = Interpolate(Color.Orange, Color.Red, 0.8);
            colors[10] = Color.Red;
    
            Rectangle rect = new Rectangle(10, 10, 20, 90);
            for (int i = 0; i < colors.Length; i++)
            {
                e.Graphics.FillRectangle(new SolidBrush(colors[i]), rect);
                rect.Offset(20, 0);
            }
    
            base.OnPaint(e);
        }
    
        private static Color Interpolate(Color a, Color b, double t)
        {
            int R = (int)(a.R + (b.R - a.R) * t);
            int G = (int)(a.G + (b.G - a.G) * t);
            int B = (int)(a.B + (b.B - a.B) * t);
            return Color.FromArgb(R, G, B);
        }
    
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a LinqtoSql query that I now want to precompile. var unorderedc = from
Currently I have written: SELECT IT_ID, SUBSTR (SYS_CONNECT_BY_PATH (grp , ','), 2) GROUPS FROM
I have an activity table with a structure like this: id prd_id act_dt grp
Have someone tried out DeCAL in Delphi 2009? I'm thinking about upgrading from 2007,
have not tested on windows. but in ubuntu when u disconnect from the network,
I have a string like these: String data = @<table id=_grp:CONSUMER_APPLICATION cellpadding=0 width=660> <tbody>
I have thread spawning function which accepts many parameters which have default values in
select cnt.loginid, grp.last_name as 'Group Name' from contact cnt right join grpmem list on
I have been having this problem in IE. I have two divs which I
I have a problem in my jquery code. I want to make a cascading

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.