This topic is now archived and is closed to further replies.

16 bit color problem

This topic is 5245 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

I am working on my first game using windows and direct x. I decided to use 16 bit color mode. As I began working on the game I noticed a problem in the colors. I use this macro to build my 16 bit colors(Thank you andre lamothe )
#define _RGB16BIT565(r,g,b) ((b & 31) + ((g & 63) << 5) + ((r & 31) << 11))
I am trying to get firrent shades of white but it is not working correctly. When I use _RGB16BIT565(255,255,255) it is perfectly white but when I use _RGB16BIT565(240,240,240) it becomes a shade of green, when it shouldn''t. I thought the problem might be solved by using this macro:
#define _RGB16BIT555(r,g,b) ((b & 31) + ((g & 31) << 5) + ((r & 31) << 10))
But that didn''t help. Any ideas? ---- Jemts "A Hooloovoo is a super-intelligent shade of the color blue."- Douglas Adams

Share this post

Link to post
Share on other sites