Calculating Color Brightness
I was working on a website today, and I stumbled into a problem of needing to compute the brightness of a color, so that if it is a background color, I know whether to show white text or black text. My first thought was to simply add up the RGB components of the color and use that value. It turns out that is completely wrong, since pure green looks much brighter than pure blue:
continue reading...