' The RGB function computes the color value using the formula ' color = blue * &HFF00& + green * &HFF& + red ' You can specify a color by either using the RGB function ' or giving its numeric value. Hexadecimal makes specifying ' numerical values easier because each of a color's components ' occupies exactly tow hexadecimal digits. If the color has ' red, green and blue components of RR, GG and BB in hexadecimal ' you can represent the color as &HBBGGRR. For example, if a ' color has a red value of &H80, a green value of &H00, and a ' blue value of &HFF, the color value is &HFF0080. Private Declare Function GetSysColor Lib "user32" _ (ByVal nIndex As Long) As Long ' Break a color into is components. Private Sub BreakColor(ByVal color As Long, ByRef r As Long, _ ByRef g As Long, ByRef b As Long) If color = &HFFFFFFFF Then color = GetSysColor(color And &HFFFFFF) End If r = color And &HFF& g = (color And &HFF00&) \ &H100& b = (color And &HFF0000) \ &H10000 End Sub