Palette generator

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

Creative Commons Attribution/Share-Alike License 3.0 (Unported)

This content is licensed under Creative Commons Attribution/Share-Alike License 3.0 (Unported). That means you may freely redistribute or modify this content under the same license conditions and must attribute the original author by placing a hyperlink from your site to this work https://planetcalc.com/5799/. Also, please do not modify any references to the original work (if any) contained in this content.

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).


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)


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
Creative Commons Attribution/Share-Alike License 3.0 (Unported) PLANETCALC, Palette generator