|
-
September 13th, 2001, 12:10 PM
#1
converting web colors to RGB
Can anyone see what's wrong with this, can't figure it...
sRGB is the web color......
Dim sRed, sBlue, sGreen as string
Dim iRed, iGreen, iBlue as Integer
sRed = "&H" & Left$(sRGB, 2)
sGreen = "&H" & mid$(sRGB, 3, 2)
sBlue = "&H" & Right$(sRGB, 2)
iRed = CInt((CLng(sRed) And CLng("&HFF0000")) / (CLng("&H00FFFF") + 1))
iGreen = CInt((CLng(sGreen) And CLng("&H00FF00")) / (CLng("&H0000FF") + 1))
iBlue = CInt((CLng(sBlue) And CLng("&H0000FF")) / (CLng("&H000000") + 1))
main.txtColour.BackColor = RGB(iRed, iGreen, iBlue)
thanx for any help
mat
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
|