|
-
Jan 15th, 2000, 04:24 PM
#1
Thread Starter
Lively Member
Is there a way to use the color picker that comes with the microsoft common dialog control to get html color codes? Or something else that I could look at so a user could click on a color and get a html color code from it?
Thanks in advanced.
-
Jan 15th, 2000, 04:42 PM
#2
So Unbanned
you need to convert the number to hex code
like black RGB(0,0,0) is 000000 and white RGB{255,255,255) is FFFFFF
------------------
DiGiTaIErRoR
-
Jan 16th, 2000, 11:52 AM
#3
Hyperactive Member
Be careful that HTML uses RGB convention (Red, Green, Blue) but VB uses BGR (Blue, Green, Red)
-
Jan 16th, 2000, 04:42 PM
#4
Here's a function you can try:
Public Function RGBHexColor(lngColor As Long) As String
Dim sHex As String
sHex = Hex(lngColor)
sHex = Right$("000000" & sHex, 6)
sHex = Right$(sHex, 2) & Mid$(sHex, 3, 2) & Left$(sHex, 2)
RGBHexColor = sHex
End Function
Just call this function and pass the color the CommonDialog returns.
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
-
Jan 17th, 2000, 12:50 PM
#5
Hyperactive Member
Hi Ryan,
I made a program to help me with hex colours. You can download it here:
http://members.xoom.com/rino_2/HexColour.zip
I hope you like it.
------------------
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
|