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

  • SEARCH
  • Home
  • 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 3341470
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:43:34+00:00 2026-05-18T00:43:34+00:00

I would like to come up with as many HEX HTML values to have

  • 0

I would like to come up with as many HEX HTML values to have a smooth color gradient from red to green:

I would like this to be similar to the following:
http://www.utexas.edu/learn/html/colors.html

I don’t have the best eye for color choices, so I’m hoping a standard chart is already put together showing how to transition from red through yellow to green smoothly.

On that website “1 of 6” is most similar to what I’m looking for, but that example is limited to 11 colors:

(1) FF0000 Red, 
(2) FF3300 Red(Orange)
(3) ff6600 
(4) ff9900 
(5) FFCC00 Gold 
(6) FFFF00 Yellow
(7) ccff00
(8) 99ff00
(9) 66ff00
(10) 33ff00
(11) 00FF00 Lime 

It would be great to be able to double the number of colors, but yet make them transition smoothly.

Thanks for any insights and help.

  • 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-05-18T00:43:35+00:00Added an answer on May 18, 2026 at 12:43 am

    Depending on how many colors you want to end up with, the solution is just to keep incrementing the green value by a certain amount, and then when green is maxed (FF), decrement the red value repeatedly by the same amount.

    Pseudo-code:

    int red = 255; //i.e. FF
    int green = 0;
    int stepSize = ?//how many colors do you want?
    while(green < 255)
    {
        green += stepSize;
        if(green > 255) { green = 255; }
        output(red, green, 0); //assume output is function that takes RGB
    }
    while(red > 0)
    {
        red -= stepSize;
        if(red < 0) { red = 0; }
        output(red, green, 0); //assume output is function that takes RGB
    }
    

    Generating by hand, you can simply increment by 16, like so:

    FF0000
    FF1000
    FF2000
    FF3000
    FF4000
    FF5000
    FF6000
    FF7000
    FF8000
    FF9000
    FFA000
    FFB000
    FFC000
    FFD000
    FFE000
    FFF000
    FFFF00 //max, step by 15
    F0FF00 //cheat, start with a -15 to simplify the rest
    E0FF00
    D0FF00
    C0FF00
    B0FF00
    A0FF00
    90FF00
    80FF00
    70FF00
    60FF00
    50FF00
    40FF00
    30FF00
    20FF00
    10FF00
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I come from a java background. But I would like a cross-platform perspective on
I have a hierarchy of directories containing many text files. I would like to
I would like to have a reference for the pros and cons of using
I would like to have an iframe take as much vertical space as it
I would like to have a VM to look at how applications appear and
I would like to come up with a Vim substitution command to turn multi-line
I've got many, many mp3 files that I would like to merge into a
I would like to have a Toast Message appear while my app is downloading
I have been asked to come up with a solution which would allow our
I would like to get a sum from a column, with and without a

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.