Public Declare Function ColorRGBToHLS Lib "shlwapi.dll" ( _
ByVal clrRGB As Long, _
pwHue As Long, _
pwLum As Long, _
pwSat As Long) As Long
Sub demo()
MsgBox GetLuminance(Selection.Cells(1).Interior.Color)
End Sub
Function GetLuminance(iColor As Long) As Long
Dim iHue As Long
Dim iSat As Long
Dim iLum As Long
ColorRGBToHLS iColor, iHue, iLum, iSat
GetLuminance = iLum
End Function