I want to draw some elements on the screen, each element is in one of N sets. The number of sets changes all the time, so I need to calculate N different colors that are as different as possible (to make it easier to determine what is in which set).
So, for example, with N = 2, my results will be black and white. With three, I think I would get everything red, all green, all blue. For all four, it’s less obvious what the correct answer is, and it is here that I have problems.
EDIT :: The obvious approach is to map 0 to red, from 1 to green and all colors between the corresponding colors of the rainbow, then you can get the color for the set N by doing GetRainbowColour (N / TotalSets), so the GetRainbowColour method is all that is needed for solutions to this problem.
source
share