I used a Java function to generate colors based on a single color.
It basically takes a color - converts it into HSV and adds a step to the Hue.
Saturation and Value are pretty fixed with a bit of randomness to get variation.
I guess the function could be improved but it produces pretty colors :)
private Color getNextColorHue(Color color){
if(color != null){
float hsbVals[] = Color.RGBtoHSB( color.getRed(), color.getGreen(), color.getBlue(), null );
hsbVals[0] += STEP;
hsbVals[1] = (float) ((Math.random() * 0.3) + 0.7);
hsbVals[2] = (float) ((Math.random() * 0.2) + 0.7);
if (hsbVals[0] > 1) {
hsbVals[0] -= 1;
}
color = Color.getHSBColor(hsbVals[0], hsbVals[1], hsbVals[2]);
}
return color;
}
Should be easy to convert it into JS with this:
RGB to HSV color in javascript?