|
-
Dec 23rd, 2002, 05:23 PM
#1
Thread Starter
Frenzied Member
VB Color Constant to HTML color code {RESOLVED}
Does anybody know convert VB ColorCionstant to HTML color code, like
17849940 to #C0C0C0
Last edited by andreys; Dec 23rd, 2002 at 05:46 PM.
-
Dec 23rd, 2002, 05:29 PM
#2
Hyperactive Member
An HTML color code is, I think, a "#" sign followed by three two-character hexadecimal values for the red, green, and blue, and I think that's the right order.
There are plenty of GetRed/GetGreen/GetBlue functions around, and the Hex$ or Hex function will convert from decimal to hexadecimal.
So: HTMLCode$ = "#" & Str(GetRed(myColor)) & Str(GetGreen(myColor)) & Str(GetBlue(myColor))
Just off the top of my head, hope it works!
-
Dec 23rd, 2002, 05:46 PM
#3
Thread Starter
Frenzied Member
Thanks. I used Hex function as you suggested. It works now.
-
Dec 23rd, 2002, 05:52 PM
#4
Hyperactive Member
No problem. Post if you have more trouble.
-
Dec 23rd, 2002, 07:34 PM
#5
Lively Member
If you want to use the VB Colour constants (like vbInfoBackground and vbButtonFace), then you need to translate those values to actual RGB values first using the OleTranslateColor API call
- gaffa
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|