Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting HTML color to number
Message
De
06/01/1998 00:17:01
 
 
À
05/01/1998 11:24:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00069534
Message ID:
00069731
Vues:
37
>One of my control used in a Web browser is having some color parameters. However, as oppose to standard HTML where we can specify CCCCCC as a color, for example, we need to specify something like -2147483643. Can someone tell what is the formula to convert something like that to its number equivalent?
>
>We have something like that in Visual FoxPro I believe for some properties. Is this the same that applies here?

Your CCCCCC is in fact a RGB color in hex in the format: RRGGBB where each letter is a HEX digit. In VFP you can write the same thing as 0xCCCCCC.

For example, if your HTML color is F3147D, in VFP you will have 0xF3147D. You can also write the following:

lnColor = 0xF3147D
?lnColor

This will print the equivalent number in decimal. Ie: no conversion is necessary. Just write the hex number prefixed by 0x.

Vlad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform