VB-Tec.de Visual Basic - Technik, FAQ, Tricks, BeispieleRGB-Farbe in HTML-Code |
Function RGB2HTML(RGB)
'Long in Hex umwandeln:
RGB2HTML = Right("00000" & Hex(RGB), 6)
'RGB-Werte richtig sortieren:
RGB2HTML = "'#" & _
Mid(RGB2HTML, 5, 2) & _
Mid(RGB2HTML, 3, 2) & _
Mid(RGB2HTML, 1, 2) & "'"
End Function
Beispiel (HTML-Wert für VB-Rot=255): RGB2HTML(255) ergibt '#FF0000'. © Jost Schwider, 30.04.2000-02.07.2000 - http://vb-tec.de/rgbfarbe.htm