Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opposite of RGB?
Message
From
18/04/2019 15:20:25
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01668191
Message ID:
01668192
Views:
87
This message has been marked as a message which has helped to the initial question of the thread.
Likes (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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform