Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine when to use black or white as label forecolor
Message
From
13/06/2005 10:20:40
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01022663
Message ID:
01022756
Views:
18
Hi David,

>Pull the color value apart into it's RGB components using RGBColor() from foxtools and then you can pick some generalized level between 0 and 255 that you want to use as the swap over point.

That's exactly where I am now. I have the R, G, and B components and am trying to figure out a simple, general case rule for looking at these values and determining light or dark color text.

MS Word provides an "Auto" color selection feature under its Format/Font dialog that automatically picks white or black text based on the text's background. I've tried to stump this feature, but it appears to work flawlessly.

This leads me to believe that there's a simple, common sense type of calculation that one can perform that provides the information I'm looking for.

Of course I could be wrong. Perhaps the bloat behind Word is a 32 million color lookup table for this function. :)

Malcolm
Malcolm Greene
Brooks-Durham
mgreene@bdurham.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform