Convert HTML colour codes to
I have this code that works in VB for converting an html colour string into a visual basic colour. How can I do the same thing in C??????
Keep in mind that RGB does not work in C so I would need an equivalent function for this also.
VB Code:
'Convert a colour represented in html colour format,
'to a long value recognizable by visual basic
Function HTMLToLong(sHTML As String) As Long
Dim lR As Long, lB As Long, lG As Long
lR = CInt(Val("&h" + Mid(sHTML, 2, 2)))
lG = CInt(Val("&h" + Mid(sHTML, 4, 2)))
lB = CInt(Val("&h" + Mid(sHTML, 6, 2)))
HTMLToLong = RGB(lR, lG, lB)
End Function