I like the random color generation algorithm proposed here by David Crow, but I wonder if there's a way to focus its results around a single color and regulate the results.
My program will be generating graphs that track a number of variables. Each variable belongs to one of 7 categories. I'd like to generate line-colors for these variables that are legible, unique and for which the hue, saturation and luminosity are within a proximate range of a root color which is associated with their category. For example, category Red's variables would be various legible and discernible variations on red.
One solution might be to declare a root color, plus upper and lower boundaries for hue, saturation and luminosity. I could then randomly pull values from within those ranges, but is there a better way to hopscotch within those three dimensions so that the resulting colors have a decent amount of variation, but still leaving space to grow? For example, assume each pipe is a range value and each line is an iteration:
01 > |---------------|---------------|
02 > |-------|-------|---------------|
03 > |-------|-------|-------|-------|
04 > |---|---|-------|-------|-------|
05 > |---|---|---|---|-------|-------|
06 > |---|---|---|---|---|---|-------|
07 > |---|---|---|---|---|---|---|---|
08 > |-|-|---|---|---|---|---|---|---|
09 > |-|-|-|-|---|---|---|---|---|---|
10 > |-|-|-|-|-|-|---|---|---|---|---|
11 > |-|-|-|-|-|-|-|-|---|---|---|---|
12 > |-|-|-|-|-|-|-|-|-|-|---|---|---|
13 > |-|-|-|-|-|-|-|-|-|-|-|-|---|---|
14 > |-|-|-|-|-|-|-|-|-|-|-|-|-|-|---|
15 > |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|
What's the best way to do this? Or is this even the best solution to my problem? A single graph may not plot more than 4 or 5 variables, but the number of variables which can be plotted could be in the hundreds.
Thanks for your help.