Hi guys,
I had troubles to go through the full RGB spectrum. the point was to go from black to white. using RGB_MAKE I got sudden changes and discovered that the green component changed its intensity in greater steps even if I was just increasing its level the same increment as the other colours (I know it has 1 bit longer resolution, but these were DRASTIC changes). look at the definition:
/* Exported defines ----------------------------------------------------------*/
//RGB is 16-bit coded as G2G1G0B4 B3B2B1B0 R4R3R2R1 R0G5G4G3
#define RGB_MAKE(xR,xG,xB) ( ( (xG&0x07)<<13 ) + ( (xG)>>5 ) + \
( ((xB)>>3) << 8 ) + \
( ((xR)>>3) << 3 ) )
unfortunately, if we would mark the bits of green component from 7 to 0, looking at the bit operation ( (xG&0x07)<<13 ) + ( (xG)>>5 ) we simply loose bits 4 and 3. I strongly recommend this definition:
#define RGB_MAKE(xR,xG,xB) ( ( (xG&0x1c)<<11 ) + ( (xG)>>5 ) + \
( ((xB)>>3) << 8 ) + \
( ((xR)>>3) << 3 ) )
it just works works let me know if it helped someone, - anyway it would be nice to find this correction in the next release - I have spent 2 hours to find out where the problem was.