Convert rgb to lightness or darkness

William Prothero prothero at earthednet.org
Thu Oct 9 13:39:04 EDT 2014


Ben:
Thanks. This does a better job.
Best,
Bill

William A. Prothero
http://es.earthednet.org/

On Oct 9, 2014, at 2:38 AM, Ben Rubinstein <benr_mc at cogapp.com> wrote:

> In the standard formula for RGB -> HSL (Hue, Saturation, Lightness), Lightness is calculated as the average of the max and min of the RGB values.  In the standard formula for RGB -> HSV (Hue, Saturation, Value), Value is the max of the RGB values.
> 
> I would guess one of those calculations would be closer to giving you the right answer than the total of R+G+B.
> 
> Ben
> 
> On 08/10/2014 09:21, Tiemo Hollmann TB wrote:
>> Just a guess, didn't tried it.
>> If you add the three RGB values of the mousecolor, white (light) would be
>> 765 and black (dark) 0. Somewhere around 382 you can switch from black to
>> yellow text.
>> Tiemo
>> 
>> 




More information about the use-livecode mailing list