|
|
Title | Break a RGB color into its red, green, and blue components |
Keywords | RGB, color, components, separate |
Categories | Graphics |
|
|
Thanks to ToitSoft
|
|
Public Sub ReverseRGB(ByVal Value As Long, Red As Integer, _
Green As Integer, Blue As Integer)
Dim lngRed As Long
Dim lngGreen As Long
Dim lngBlue As Long
lngBlue = Int(Value / 65536)
lngGreen = Int((Value - (65536 * lngBlue)) / 256)
lngRed = Value - ((lngBlue * 65536) + (lngGreen * 256))
Red = lngRed
Green = lngGreen
Blue = lngBlue
End Sub
|
|
Formatted by
Neil Crosby
|
|
|
|
|
|