Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opposite of RGB?
Message
De
18/04/2019 15:20:25
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01668191
Message ID:
01668192
Vues:
88
This message has been marked as a message which has helped to the initial question of the thread.
J'aime (1)
>Hi everybody,
>
>We store result of the GetColor function in the database as integer value. Now we want to use this in Web Application to set the color. Do you know what is the simplest way to convert this integer value into the value suitable for HTML (in C# / JavaScript code, if possible)?
>
>Thanks in advance.

Naomi,

Prepend its hexadecimal value with # and you can use the full string as the value for a color in HTML.
'#' + (rgbColorValueAsResultOfGetColor).toString(16);
Edited: not exactly this simple, because of the way HTML uses hex shorthand (for instance, "#ccc" is in fact read as "#cccccc")...
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform