VB Code:
  1. Function GetRValue(ByVal nColor As Long) As Long
  2.  
  3.     GetRValue = nColor And &HFF&
  4.  
  5. End Function
  6.  
  7. Function GetGValue(ByVal nColor As Long) As Long
  8.  
  9.     GetGValue = (nColor \ &H100&) And &HFF&
  10.  
  11. End Function
  12.  
  13. Function GetBValue(ByVal nColor As Long) As Long
  14.  
  15.     GetBValue = (nColor \ &H10000) And &HFF&
  16.  
  17. End Function