Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine when to use black or white as label forecolor
Message
De
13/06/2005 10:20:40
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01022663
Message ID:
01022756
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform