Look for an RGB to HSL or HSB converter. The L and B stand for lightness and brightness respectively. They're not quite the same, but both indicate the value you're looking for. Just split your hex into three letter pairs, convert each to binary to get RGB, and run through the converter to get HS(B|L), and check out the B/L value to see if it's "light" or "dark",
cheers, barneyb On 8/16/05, Scott Weikert <[EMAIL PROTECTED]> wrote: > 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 > > -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:215354 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=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

