Public Function RGBToHex(Red As Integer, Green As Integer, Blue As Integer)Contoh penggunaan fungsi konversi warna dari RGB ke HEX
RGBToHex = Right(0 & Hex(Red), 2) & Right(0 & Hex(Green), 2) & Right(0 & Hex(Blue), 2)
End Function
Private Sub Command1_Click()
MsgBox RGBToHex(0, 0, 12)
End Sub