Howto: Calculate brightness from RGB-Color?
-
Hello! I need to calculate a bright text-color when a background is dark and a dark textcolor when the background is bright. Does anyone have an idea how to calculate the brightness of a rgb-value to do this? Thanks a lot!
-
Hello! I need to calculate a bright text-color when a background is dark and a dark textcolor when the background is bright. Does anyone have an idea how to calculate the brightness of a rgb-value to do this? Thanks a lot!
Yep - you need to convert the RGB value to another form : hue, saturation and value (or lightness). Essentially, the lightness is your intensity. The basic concept is that you are navigating the color cube. When I had to do this, I converted the RGB value to HSV, adjusted the HSV, and then returned to RGB space. chg C. Gilley Will program for food... My son's PDA is an M249 SAW.