For Example The BackColor For The Form Is 123456
What Is The RGB Equvalant To It
Thanks For All In Advanced
Try the following will work:
Function Red(ColourValue As Long) As Long
Dim strHexColour As String
strHexColour = Right$("000000" & Hex(ColourValue), 6)
Red = CLng("&H" & Right$(strHexColour, 2))
End Function
Function Green(ColourValue As Long) As Long
Dim strHexColour As String
strHexColour = Right$("000000" & Hex(ColourValue), 6)
Green = CLng("&H" & Mid$(strHexColour, 3, 2))
End Function
Function Blue(ColourValue As Long) As Long
Dim strHexColour As String
strHexColour = Right$("000000" & Hex(ColourValue), 6)
Blue = CLng("&H" & Left$(strHexColour, 2))
End Function
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"RABEA" <ShamiJe...@Yahoo.com> wrote in message
news:uIwthgS9...@TK2MSFTNGP04.phx.gbl...
You could use bit-wise operators:
Sub SplitRGB( _
ByVal RGBValue As Long, _
ByRef R As Long, _
ByRef G As Long, _
ByRef B As Long _
)
R = RGBValue And 255
G = RGBValue \ 256 And 255
B = RGBValue \ 256 ^ 2 And 255
End Sub
Jamie.
--
Pieter
"Jamie Collins" <jamiec...@xsmail.com> wrote in message
news:1189686614.1...@57g2000hsv.googlegroups.com...
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"RABEA" <ShamiJe...@Yahoo.com> wrote in message
news:uIwthgS9...@TK2MSFTNGP04.phx.gbl...