I am writing a colour class that also stores the Hue, Brightness and Saturation (which in turn can be changed to alter the Red Green and Blue values).
Using Paint.Net (graphics package) as a comparision I've got the Hue and Saturation part sorted. However the Brightness is not quite right.
Paint.Net RGB | Paint.Net HSB | MyHSB
-------------------------------------
163 | 21 | 21
128 | 33 | 33
109 | 63 | 52
All reading I've found suggests there are different ways of working it out but the formula I've been using is...
nBri = (0.2126*r) + (0.7152*g) + (0.0722*b)
which doesn't match. So I am wondering, how would you all calculate the brightness from red green and blue?
|