Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting HTML color to number
Message
De
06/01/1998 18:35:43
 
 
À
06/01/1998 17:15:39
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00069534
Message ID:
00069937
Vues:
39
>>Here's what I use. You can pass it an RGB color value (ie RGB(192,192,192)) or
>>the numbers you're using (I think those appear to be RGB values).
>
>In my case, I would like to pass CCCCCC. This is why I mentioned this function may not be what I am looking for.
>
>I also don't understand why there is negative numbers in that sample I took from Sheridan grid control. One of the parameters is going like this PARAM NAME="BackColor" VALUE="-2147483643".

The negative number comes from the internal representation of the signed integer values. The sign is the left most bit, so if you want to have this bit set on 1, you use a negative value. The -2147483643 decimal value is 80000005 in hex.

Since the color representation is usually on 24 bits, the first 8 bits (from left) are not used. So, I don't really get why they use that value. IMO, that value should be the same as 5 for color representation. But maybe I don't understand something.

Vlad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform