I found this code on the forum and it's working great, but I can't really understand its functionality. This code converts Color values as used by VB to HTML Colors (certain kind of Hexadecimal colors). Does somebody have a code that does the opposite; convert HTML Colors to VB understandable code?
Thx :)
[edit]o ****, posted it in Chit Chat... can a mod kick this to the VB General Questions?[/edit]
VB Code:
Public Function ColorHTML(Number As Long) As String Dim MyString As String, MyNum As Long, MyCalc As Long, MyRemainder As Long, X As Integer MyRemainder = Number MyString = "" For X = 2 To 0 Step -1 MyCalc = MyRemainder \ 256 ^ X MyString = Format$(Hex(MyCalc), "00") & MyString MyRemainder = MyRemainder - MyCalc * 256 ^ X Next txtColor.Text = MyString End Function
