extracting color values from D3DCOLOR(DWORD)

Started by
0 comments, last by mdias 18 years, 7 months ago
i want to get the a,r,g,b values from the D3DCOLOR wich is a DWORD type value,how?
Advertisement
D3DCOLOR format is ARGB, so you'd do something like this:
// assume color is a D3DCOLOR variableBYTE a = color >> 24;BYTE r = (color >> 16) & 0xFF;BYTE g = (color >> 8 ) & 0xFF;BYTE b = color & 0xFF;

This topic is closed to new replies.

Advertisement