How to modify color brightness in C#?

2019-09-01 14:00发布

问题:

In c#, you can get the HSL brightness of a color by doing Color.GetBrightness(). If I want to increase the brightness of a color by a certain percentage, I cannot simply multiply the individual RGB values by that amount. It seems HSL doesn't work like that. How would I do it?

回答1:

I think this article can help you with this and all other color related questions. It has C# source for all conversions and modifications.

RGB and HSL Colour Space Conversions