Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
TextBox1.ForeColor = 255
65280
16711680
RGB(0,0,255)
16711680
Public Function RGBReverse(lngColour As Long) As Variant
On Error GoTo Err_RGBReverse
Dim R As String
Dim G As String
Dim B As String
Dim intR As Integer
Dim intG As Integer
Dim intB As Integer
Dim strHexColour As String
Dim varResult(2) As Variant
strHexColour = LPad(Hex(lngColour), "0", 6)
R = Right$(strHexColour, 2)
G = Mid$(strHexColour, 3, 2)
B = Left$(strHexColour, 2)
intR = Val("&H" & R)
intG = Val("&H" & G)
intB = Val("&H" & B)
varResult(0) = intR
varResult(1) = intG
varResult(2) = intB
Debug.Print "R: " & varResult(0), "G: " & varResult(1), "B: " & varResult(2)
RGBReverse = varResult
Exit_RGBReverse:
Exit Function
Err_RGBReverse:
MsgBox Err & ": " & Err.Description
'LogError "MyDesignUtilities", "RGBReverse", Err.Number, Err.Description
Resume Exit_RGBReverse
End Function
Function LPad(ByVal strToPad As String, strPadChar As String, intMinLength As Integer) As String
Do Until Len(strToPad) >= intMinLength
strToPad = strPadChar & strToPad
Loop
LPad = strToPad
End Function