K
Karsten Wutzke
Hello all!
I need some way to assign a color to an ID. There are two approaches
that I can implement:
1. Randomize the references to Color in the color array on application
startup and use an index into that shuffled array. This will always make
different colors for the ID=0 and different program starts.
2. Use some other more static way, so that id=0 will always be red, id=1
will always be green, id=2 will always be orange etc. on every program
startup. This could be a look up table. However, this will only be a
backup solution, if I don't find a good algorithm to do a nice randomize
of the colors so that similar colors are pretty much scattered linearly
in the array: All red-like colors, if there are 6, appear at indices 0,
6, 12, 18, 24, 30.
Does anyone have an idea of how one of these algorithms might look like?
BTW: I only need 36 colors. These are the hues in a 360 deg color circle.
Thanks for your help!
Karsten
I need some way to assign a color to an ID. There are two approaches
that I can implement:
1. Randomize the references to Color in the color array on application
startup and use an index into that shuffled array. This will always make
different colors for the ID=0 and different program starts.
2. Use some other more static way, so that id=0 will always be red, id=1
will always be green, id=2 will always be orange etc. on every program
startup. This could be a look up table. However, this will only be a
backup solution, if I don't find a good algorithm to do a nice randomize
of the colors so that similar colors are pretty much scattered linearly
in the array: All red-like colors, if there are 6, appear at indices 0,
6, 12, 18, 24, 30.
Does anyone have an idea of how one of these algorithms might look like?
BTW: I only need 36 colors. These are the hues in a 360 deg color circle.
Thanks for your help!
Karsten