Programmatically change colors in C #

I am currently working on a project where, when different users add text to a document, I would like to change the color of the text.

Initially, I used C # predefined color values ​​and just put the ones I wanted to use in enum in my application, and rode my bike around colors as different users added annotations. This works great, and I'm fine with this solution.

However, I could also choose to change the RGB values ​​and the resulting colors. I am wondering what type of algorithm would be good to change these values ​​to get different sets of colors. This is most likely the one exercise I was thinking about.

To clarify a bit, I don’t want to just increase one of the color values ​​(R, G or B), because it will not give me enough variety in my colors. But I do not think that this will also work to increase all three equal amounts. I also have to keep track of repeating colors (down to the point). The requirements for my project involve, at best, 10 different reviewers.

+5
source share
1 answer

The best you can do for this kind of problem is to use the HSL or HSV values ​​and only vary the hue. Then convert back to RGB.

See this link for more information .

+4
source

All Articles