Click to See Complete Forum and Search --> : RGB


May 12th, 1999, 08:23 AM
Hi,
I have some list of RGB colors given like RGB(255,0,0) or any which i need to convert it in Standar Color number. Please try assist.

Thanks

Abadon
May 13th, 1999, 10:25 AM
You can either use a color mask or just bit shift.

I like bit shifting. Say Red is 170, Green is 100, Blue is 40.

DWORD bitcolor = (red << 16) + (green << 8) + blue;

Thats it, hope this helps.
Regards,
Abadon.