Page 1 of 1

Evaluating RGB?

Posted: Wed Nov 23, 2016 12:40 pm
by teacherguy
I would like to change the drop shadow behind text from black to white depending on the textcolor that the user selects. Does anyone have a way of evaluating the RGB in order to determine a darker color (say blue) from a lighter one (say yellow)?

Re: Evaluating RGB?

Posted: Wed Nov 23, 2016 3:09 pm
by dunbarx
Hi.

Well, "0,0,0" is pretty light, and if you start increasing the values of any of the three RGB values, the color will get "darker".

But is full yellow darker than full red? No, I guess. I think it better if you limit the color options to a fixed set, and create a look-up table so that you can map one to the other as you desire.

Craig Newman

Re: Evaluating RGB?

Posted: Wed Nov 23, 2016 5:39 pm
by jacque
I think you're looking for luminance values:

http://runtime-revolution.278305.n4.nab ... l#a4709206

Re: Evaluating RGB?

Posted: Wed Nov 23, 2016 7:14 pm
by teacherguy
Superb, thanks Jacque