Try this: http://www.cflib.org/udf.cfm?ID=322 

You can then consider the "L" portion of the result. If it's 128 or
greater, use dark; if 127 or less, use light. 


-----Original Message-----
From: Scott Weikert [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 17 August 2005 10:46 a.m.
To: CF-Talk
Subject: SOT: determining darkness/lightness of hex colors

Hey gang,

I've done some Googling on this but haven't found anything helpful.

I'm looking for a way to determine, for lack of better terms, the 
darkness/lightness of a particular hex color, so as to determine whether

to use light or dark text above it so that the text doesn't get lost in 
the color beneath.

Any nudges in the right direction (custom tag, algorithm, etc.) would 
simply rock.

Thanks much -
--Scott



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:215724
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to