Get reference code
Appearance
Sample
Palette generator

Palette generator

This calculator generates palette of colors from starting color to ending color, using maximum diversity, "rainbow" style.
Timur2016-08-25 19:27:31

This calculator below generates colors set from given starting color to given ending colors, producing rainbow like colors band. This can be used for website, or for chart bars/lines coloring, etc. I explain method for colors generation below the calculator.

Palette generatorCreative Commons Attribution/Share-Alike License 3.0 (Unported)
Color table:

The task to generate colors set between two given colors is not as trivial as you may think. The problem is that the programmers (may be designers too, I am not sure) often use RGB model for description of color. It consists of three values of red, green and blue colors. If we visualize it as cube in 3-coordinate space, we will get something like that (source).

http://commons.wikimedia.org/wiki/File%3ARGBCube_b.svg

Now imagine we have two points in this three dimensional space - it is quite hard to create simple enough method to move from one color point to another color point and get meaningful results.

But everyrthing is changing if we describe color in HSV color model.
Here is its visualization (source)

http://commons.wikimedia.org/wiki/File:HSV_cone.png

Now we can easily make movement from one color to another. This is how this calculator works - it converts RGB colors into HSV colors and then uses simple linear interpolation to generate set of colors between them. The only note is that using it we transform colors from 16777216 RBG color space (0-255, 0-255, 0-255) to 3600000 HSV color space (0-360, 0-100, 0-100), and back tranformation can give slightly different values for starting and ending colors.

Request a calculator
View all calculators
(486 calculators in total. )

Comments