/ Published in: VB.NET
Convert hexidecimal color codes (ie #C0C0C0) to decimal RGB (ie 255,255,255)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Public Function GiveDec(Hex) if Hex = "A" then Value = 10 elseif Hex = "B" then Value = 11 elseif Hex = "C" then Value = 12 elseif Hex = "D" then Value = 13 elseif Hex = "E" then Value = 14 elseif Hex = "F" then Value = 15 else Value = Hex end if GiveDec = Value End Function Public Function HexToDec(Hex) Dim a,b,c,d,e,f,x,y,z,fHex a = GiveDec(a) b = Mid(fHex,2,1) b = GiveDec(b) c = Mid(fHex,3,1) c = GiveDec(c) d = Mid(fHex,4,1) d = GiveDec(d) e = Mid(fHex,5,1) e = GiveDec(e) f = GiveDec(f) x = (a * 16) + b y = (c * 16) + d z = (e * 16) + f HexToDec = """" & x & "," & y & "," & z & """" End Function
URL: http://codefinds.blogspot.com/2007/10/hex-to-dec-vbscript.html