Josh Close Josh Close - 2 years ago 78
C# Question

C# Algorithm to Tint a Color a Certain Percent

I have a color and I want get a tint of that color by a certain percent. So 100% is the color itself, 90% is a slightly lighter color, etc. Basically, it's like adding 10% of opacity to the color, if the color is on a white background. I need to convert the color into a hex HTML color value, so I don't want transparency.

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

Answer Source

Yep there are a lot of different ways to do this. One way would be to convert from RGB to HSB (Hue, Saturation, Brightness) and then crank the brightness down some percentage.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download