• Advertisement
Sign in to follow this  

extracting color values from D3DCOLOR(DWORD)

This topic is 4615 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

D3DCOLOR format is ARGB, so you'd do something like this:

// assume color is a D3DCOLOR variable
BYTE a = color >> 24;
BYTE r = (color >> 16) & 0xFF;
BYTE g = (color >> 8 ) & 0xFF;
BYTE b = color & 0xFF;

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement