From 56b8e99c10517622f640aae30a8582b6947377ce Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sun, 11 Nov 2007 21:31:38 +0000 Subject: 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 --- firmware/export/lcd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index eedfc651c7..2e481fc938 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -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 */ -- cgit v1.2.3