RGB Colors in 16 bits help !
I really need help in understanding how the colors are coded in RGB using 16bits depth, i cant figure it out i dont know if im tired or something but...
im using that macro btw
#define RGB16(r,g,b) ((r << 11) + (g << 5) + b)
and i cant figure out how to put the color #2e2e2e in that
Leo
"The bible is probably the most genocidal book ever written!" Noam Chomsky
Your macro is wrong. If you want a 565 macro it should look like this:
#define RGB16(red, green, blue) ( ((red >> 3) << 11) | ((green >> 2) << 5) | (blue >> 3))
If you want to learn why the macro is like that, I explain it in this thread.
***********************
#define RGB16(red, green, blue) ( ((red >> 3) << 11) | ((green >> 2) << 5) | (blue >> 3))
If you want to learn why the macro is like that, I explain it in this thread.
***********************
BigSassy,
Just wanted to say that that was REALLY well done explanation.
Just wanted to say that that was REALLY well done explanation.
"I thought Genius lived in bottles..." - Patrick Star
quote: Original post by XanthThanks. Just trying to give back to the community
BigSassy,
Just wanted to say that that was REALLY well done explanation.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement