C # algorithm for color tint of a certain percentage

I have a color, and I want to get a shade of this color by a certain percentage. Thus, 100% is the color itself, 90% is a slightly light color, etc. Basically, it is like adding 10% opacity to a color if the color is on a white background. I need to convert the color to a color value of hexadecimal color, so I don't want transparency.

Is there an algorithm to get a hue of the value of System.Drawing.Color RGB?

+3
source share
1 answer

Yes, there are many different ways to do this. One way: convert from RGB to HSB (hue, saturation, brightness), and then scroll the brightness by a certain percentage.

+6
source

Source: https://habr.com/ru/post/1713087/


All Articles