I would like to know if there is a simple algorithm (or jQuery plugin) to select distinguishable colors, up to about 20 different colors. If there is not, where can I find an array of distinguishable colors that I could use directly ?
My use case is to generate different colors for pie charts.
My idea is to start from HSV color model and walk around the perimeter (hue) with maximal saturation and value:
The
distinctColors(10)produces:Hard to tell by only looking at RGB values, but they should be as different as possible. I have taken the
hsvToRgb()implementation from here.