Does anyone know how I get the value from the RGB function back to R,G,B values?
Printable View
Does anyone know how I get the value from the RGB function back to R,G,B values?
Sure thing!
Then you can do something like this to text it:Code:Public Function GetRGB(pColor as long) as String
Dim intBlue As Integer
Dim intRed As Integer
Dim intGreen As Integer
Dim lngColor As Long
intBlue = Int(pColor / 65536)
intGreen = Int((pColor - (65536 * intBlue)) / 256)
intRed = pColor - (intBlue * 65536) - (intGreen * 256)
GetRGB = "RGB(" & intRed & "," & intGreen & "," & intBlue & ")"
End Function
[Edited by Serge on 09-15-2000 at 02:09 PM]Code:Private Sub Command1_Click()
MsgBox GetRGB(RGB(10, 50, 35))
End Sub
Hey.. I have already figured it out..
R = x * 1
G = x * 256
B = x * 65536
Now.. just get the value and count backwards..
sorry for your time..