(RGUI) Fix color conversion
This commit is contained in:
parent
e645f44d5e
commit
0a8a5c9efc
|
@ -39,18 +39,18 @@
|
||||||
#define NORMAL_COLOR 0x7FFF
|
#define NORMAL_COLOR 0x7FFF
|
||||||
#define TITLE_COLOR HOVER_COLOR
|
#define TITLE_COLOR HOVER_COLOR
|
||||||
#else
|
#else
|
||||||
#define HOVER_COLOR (argb32_to_argb4444(g_settings.menu.entry_hover_color))
|
#define HOVER_COLOR (argb32_to_rgba4444(g_settings.menu.entry_hover_color))
|
||||||
#define NORMAL_COLOR (argb32_to_argb4444(g_settings.menu.entry_normal_color))
|
#define NORMAL_COLOR (argb32_to_rgba4444(g_settings.menu.entry_normal_color))
|
||||||
#define TITLE_COLOR (argb32_to_argb4444(g_settings.menu.title_color))
|
#define TITLE_COLOR (argb32_to_rgba4444(g_settings.menu.title_color))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline uint16_t argb32_to_argb4444(uint32_t col)
|
static inline uint16_t argb32_to_rgba4444(uint32_t col)
|
||||||
{
|
{
|
||||||
unsigned r = (col & 0xff) >> 4;
|
unsigned r = (col & 0xff) >> 4;
|
||||||
unsigned g = ((col >> 8) & 0xff) >> 4;
|
unsigned g = ((col >> 8) & 0xff) >> 4;
|
||||||
unsigned b = ((col >> 16) & 0xff) >> 4;
|
unsigned b = ((col >> 16) & 0xff) >> 4;
|
||||||
unsigned a = ((col >> 24) & 0xff) >> 4;
|
unsigned a = ((col >> 24) & 0xff) >> 4;
|
||||||
return r | g << 4 | b << 8 | a << 12;
|
return (r << 12) | (g << 8) | (b << 4) | a;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rgui_entry_iterate(unsigned action)
|
static int rgui_entry_iterate(unsigned action)
|
||||||
|
|
Loading…
Reference in New Issue