When unpacking a 16-bit color value to 24 bits, repeat the high bits of each component rather than the low bits. This makes the RGB value displayed in the color picker (and in settings files) more accurate. E.g., when using the reported color in a background, it will no longer be dithered.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15589 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Magnus Holmgren 2007-11-11 21:31:38 +00:00
parent e71bc67d94
commit 56b8e99c10

View file

@ -190,9 +190,9 @@ static inline unsigned lcd_color_to_native(unsigned color)
/* pack/unpack 24-bit RGB values */
#define _RGBPACK(r, g, b) _RGBPACK_LCD((r) >> 3, (g) >> 2, (b) >> 3)
#define _RGB_UNPACK_RED(x) ( (((x) >> 8) & 0xf8) | (((x) >> 11) & 0x07) )
#define _RGB_UNPACK_GREEN(x) ( (((x) >> 3) & 0xfc) | (((x) >> 5) & 0x03) )
#define _RGB_UNPACK_BLUE(x) ( (((x) << 3) & 0xf8) | (((x) ) & 0x07) )
#define _RGB_UNPACK_RED(x) ( (((x) >> 8) & 0xf8) | (((x) >> 13) & 0x07) )
#define _RGB_UNPACK_GREEN(x) ( (((x) >> 3) & 0xfc) | (((x) >> 9) & 0x03) )
#define _RGB_UNPACK_BLUE(x) ( (((x) << 3) & 0xf8) | (((x) >> 2) & 0x07) )
#if (LCD_PIXELFORMAT == RGB565SWAPPED)
/* RGB3553 */