The tip doesn't work:
Public Function UnRGB(RGBCol As Long, Part As Integer) As Integer
'Part: 0=Red, 1=Green, 2=Blue

Select Case Part
Case 0
UnRGB = RGBCol And &HFF
' mask 000000000000000011111111 and shift bits right
Case 1
UnRGB = (RGBCol And &HFF00) / &HFF
' mask 000000001111111100000000 and shift bits right
Case 2
UnRGB = (RGBCol And &HFF0000) / &HFFFF
' mask 111111110000000000000000 and shift bits right
End Select

End Function


It overflows on G and B value, but R works right, i need a working one :-) It's supposed to convert an RGB value (such as the RGB function) into the specified part (R G or B).

------------------
-Mystiq

[This message has been edited by mystiq (edited 11-27-1999).]

[This message has been edited by mystiq (edited 11-27-1999).]