For my program I am trying to create a function that will generate an array of colors (should be the same each time so no randomness) where each colors is much different from the other colors.
Why might you ask? Well, because the user can add custom items to a user control and with the addition of each item the item should be associated with a specific color.
Obviously this would be bad:
Red
Dark Red
Light Red
Pink
Because visually all of these are quite similar in tint and color and the user would not be able to differentiate them. Ideally the function would yield something like this:
Red
Dark Green
Light Cyan
Orange
In this case each color is much different from the other colors and the user can easily tell them apart visually.
However, I'm having a bit of trouble coming up with an algorithm that does this. I know I want to use Color.FromArgb but I'm not exactly sure how to construct the loops where each item is much different from the others yet it is the same each time the function is ran. The modulus operator might be helpful.. I have been messing around with different approaches but each there is always a color too similar to another color in the array. I want to do it with a loop but that seems to kind of imply a pattern and a similarity in either tint, hue, or brightness between all the colors.
I suppose I could hardcode a ton of values but I'd really rather not.. =X
Well, if any of you have an idea please let me know! Thanks!!