Convert rgb to lightness or darkness

William Prothero prothero at earthednet.org
Tue Oct 7 15:59:08 EDT 2014


Folks:
I’m putting text on an image that will be turned into a snapshot. The image goes from light to dark. The text is a one or two digit integer. I want it to show up on the image. For dark parts of the image, I set it to yellow, but for light parts of the image, I want to set it to black. Is there a simple formula for changing an rgb value into a darkness value that will let me choose between yellow or black text?  I don’t want to just set the ink of the text because sometimes I write the text over itself, which diminishes the effect.

Thanks,
Bill

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




More information about the use-livecode mailing list