Home » U++ Library support » U++ Widgets - General questions or Mixed problems » does exist a HtmlToColor?
does exist a HtmlToColor? [message #10307] |
Sun, 01 July 2007 13:20 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
with ColorToHtml() I obtain a color string usuful while I create html page.
I would like to know if there is something that works in the opposite direction i.e. from code "FFFFFF" to Color(r,g,b). In fact I've such strings and I need to feed ColorPushers.
Even a HexToInt would be enough if exist, otherwise I'll write it.
Thanks,
Luigi
[Updated on: Sun, 01 July 2007 15:18] Report message to a moderator
|
|
|
Re: does exist a HtmlToColor? [message #10308 is a reply to message #10307] |
Sun, 01 July 2007 16:57 |
|
mirek
Messages: 13976 Registered: November 2005
|
Ultimate Member |
|
|
Routines you can use to convert from hex text string:
unsigned stou(const char *ptr, void *endptr = NULL, unsigned base = 10);
inline unsigned stou(const byte *ptr, void *endptr = NULL, unsigned base = 10) { return stou((const char *)ptr, endptr, base); }
unsigned stou(const wchar *ptr, void *endptr = NULL, unsigned base = 10);
uint64 stou64(const char *s, void *endptr = NULL, unsigned base = 10);
int ScanInt(const char *ptr, const char **endptr = NULL, int radix = 10);
int ScanInt(const wchar *ptr, const wchar **endptr = NULL, int radix = 10);
(Use 16 instead of 10...)
|
|
|
Goto Forum:
Current Time: Fri May 10 00:38:08 CEST 2024
Total time taken to generate the page: 0.02491 seconds
|