5 * th9x - http://code.google.com/p/th9x
6 * er9x - http://code.google.com/p/er9x
7 * gruvin9x - http://code.google.com/p/gruvin9x
9 * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
24 // remove windows default definitions
28 #define RGB(r, g, b) (uint16_t)((((r) & 0xF8) << 8) + (((g) & 0xFC) << 3) + (((b) & 0xF8) >> 3))
29 #define ARGB(a, r, g, b) (uint16_t)((((a) & 0xF0) << 8) + (((r) & 0xF0) << 4) + (((g) & 0xF0) << 0) + (((b) & 0xF0) >> 4))
31 #define WHITE RGB(0xFF, 0xFF, 0xFF)
32 #define BLACK RGB(0, 0, 0)
33 #define YELLOW RGB(0xF0, 0xD0, 0x10)
34 #define BLUE RGB(0x30, 0xA0, 0xE0)
35 #define GREY RGB(96, 96, 96)
36 #define DARKGREY RGB(64, 64, 64)
37 #define LIGHTGREY RGB(180, 180, 180)
38 #define RED RGB(229, 32, 30)
39 #define DARKRED RGB(160, 0, 6)
40 #define GREEN RGB(25, 150, 50)
42 #define OPACITY_MAX 0x0F
43 #define OPACITY(x) ((x)<<24)
49 TEXT_INVERTED_COLOR_INDEX
,
50 TEXT_INVERTED_BGCOLOR_INDEX
,
51 TEXT_STATUSBAR_COLOR_INDEX
,
53 SCROLLBOX_COLOR_INDEX
,
54 MENU_TITLE_BGCOLOR_INDEX
,
55 MENU_TITLE_COLOR_INDEX
,
56 MENU_TITLE_DISABLE_COLOR_INDEX
,
60 TEXT_DISABLE_COLOR_INDEX
,
61 CURVE_AXIS_COLOR_INDEX
,
63 CURVE_CURSOR_COLOR_INDEX
,
65 HEADER_ICON_BGCOLOR_INDEX
,
66 HEADER_CURRENT_BGCOLOR_INDEX
,
69 TRIM_SHADOW_COLOR_INDEX
,
70 MAINVIEW_PANES_COLOR_INDEX
,
71 MAINVIEW_GRAPHICS_COLOR_INDEX
,
74 BARGRAPH1_COLOR_INDEX
,
75 BARGRAPH2_COLOR_INDEX
,
76 BARGRAPH_BGCOLOR_INDEX
,
80 extern uint16_t lcdColorTable
[LCD_COLOR_COUNT
];
82 #define COLOR(index) ((index) << 16)
83 #define COLOR_IDX(att) uint8_t((att) >> 16)
85 #define TEXT_COLOR COLOR(TEXT_COLOR_INDEX)
86 #define TEXT_BGCOLOR COLOR(TEXT_BGCOLOR_INDEX)
87 #define TEXT_INVERTED_COLOR COLOR(TEXT_INVERTED_COLOR_INDEX)
88 #define TEXT_INVERTED_BGCOLOR COLOR(TEXT_INVERTED_BGCOLOR_INDEX)
89 #define TEXT_STATUSBAR_COLOR COLOR(TEXT_STATUSBAR_COLOR_INDEX)
90 #define LINE_COLOR COLOR(LINE_COLOR_INDEX)
91 #define SCROLLBOX_COLOR COLOR(SCROLLBOX_COLOR_INDEX)
92 #define HEADER_SEPARATOR_COLOR COLOR(HEADER_SEPARATOR_COLOR_INDEX)
93 #define MENU_TITLE_BGCOLOR COLOR(MENU_TITLE_BGCOLOR_INDEX)
94 #define MENU_TITLE_COLOR COLOR(MENU_TITLE_COLOR_INDEX)
95 #define MENU_TITLE_DISABLE_COLOR COLOR(MENU_TITLE_DISABLE_COLOR_INDEX)
96 #define HEADER_COLOR COLOR(HEADER_COLOR_INDEX)
97 #define ALARM_COLOR COLOR(ALARM_COLOR_INDEX)
98 #define WARNING_COLOR COLOR(WARNING_COLOR_INDEX)
99 #define TEXT_DISABLE_COLOR COLOR(TEXT_DISABLE_COLOR_INDEX)
100 #define CURVE_AXIS_COLOR COLOR(CURVE_AXIS_COLOR_INDEX)
101 #define CURVE_COLOR COLOR(CURVE_COLOR_INDEX)
102 #define CURVE_CURSOR_COLOR COLOR(CURVE_CURSOR_COLOR_INDEX)
103 #define TITLE_BGCOLOR COLOR(TITLE_BGCOLOR_INDEX)
104 #define TRIM_BGCOLOR COLOR(TRIM_BGCOLOR_INDEX)
105 #define TRIM_SHADOW_COLOR COLOR(TRIM_SHADOW_COLOR_INDEX)
106 #define HEADER_BGCOLOR COLOR(HEADER_BGCOLOR_INDEX)
107 #define HEADER_ICON_BGCOLOR COLOR(HEADER_ICON_BGCOLOR_INDEX)
108 #define HEADER_CURRENT_BGCOLOR COLOR(HEADER_CURRENT_BGCOLOR_INDEX)
109 #define MAINVIEW_PANES_COLOR COLOR(MAINVIEW_PANES_COLOR_INDEX)
110 #define MAINVIEW_GRAPHICS_COLOR COLOR(MAINVIEW_GRAPHICS_COLOR_INDEX)
111 #define OVERLAY_COLOR COLOR(OVERLAY_COLOR_INDEX)
112 #define BARGRAPH1_COLOR COLOR(BARGRAPH1_COLOR_INDEX)
113 #define BARGRAPH2_COLOR COLOR(BARGRAPH2_COLOR_INDEX)
114 #define BARGRAPH_BGCOLOR COLOR(BARGRAPH_BGCOLOR_INDEX)
115 #define CUSTOM_COLOR COLOR(CUSTOM_COLOR_INDEX)
117 #define ARGB_SPLIT(color, a, r, g, b) \
118 uint16_t a = ((color) & 0xF000) >> 12; \
119 uint16_t r = ((color) & 0x0F00) >> 8; \
120 uint16_t g = ((color) & 0x00F0) >> 4; \
121 uint16_t b = ((color) & 0x000F)
123 #define RGB_SPLIT(color, r, g, b) \
124 uint16_t r = ((color) & 0xF800) >> 11; \
125 uint16_t g = ((color) & 0x07E0) >> 5; \
126 uint16_t b = ((color) & 0x001F)
128 #define RGB_JOIN(r, g, b) \
129 (((r) << 11) + ((g) << 5) + (b))
131 #define GET_RED(color) \
132 (((color) & 0xF800) >> 8)
134 #define GET_GREEN(color) \
135 (((color) & 0x07E0) >> 3)
137 #define GET_BLUE(color) \
138 (((color) & 0x001F) << 3)