Palette generator

This calculator generates palette of colors from starting color to ending color, using maximum diversity, "rainbow" style.

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

PLANETCALC, Palette generator

Palette generator

The file is very large. Browser slowdown may occur during loading and creation.

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

http://commons.wikimedia.org/wiki/File%3ARGBCube_b.svg
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 a simple enough method to move from one color point to another color point and get meaningful results.

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

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

Now we can easily move 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 a 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 transformation can give slightly different values for starting and ending colors.

URL copied to clipboard
PLANETCALC, Palette generator

Comments