Skip to content

Commit 7e0a259

Browse files
rhapsodyvvgadreau
authored andcommitted
Allow ColorUI color customization (MarlinFirmware#19484)
1 parent 2e980a1 commit 7e0a259

File tree

1 file changed

+92
-30
lines changed

1 file changed

+92
-30
lines changed

Marlin/src/lcd/tft/tft_color.h

+92-30
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
#pragma once
2323

24+
#include "../../inc/MarlinConfigPre.h"
25+
2426
#define RED(color) ((color >> 8) & 0xF8)
2527
#define GREEN(color) ((color >> 3) & 0xFC)
2628
#define BLUE(color) ((color << 3) & 0xF8)
@@ -70,45 +72,105 @@
7072
#ifndef COLOR_BACKGROUND
7173
#define COLOR_BACKGROUND 0x20AC // #1E156E
7274
#endif
73-
#define COLOR_SELECTION_BG 0x9930 // #992380
74-
#define COLOR_WEBSITE_URL 0x03B7
75+
#ifndef COLOR_SELECTION_BG
76+
#define COLOR_SELECTION_BG 0x9930 // #992380
77+
#endif
78+
#ifndef COLOR_WEBSITE_URL
79+
#define COLOR_WEBSITE_URL 0x03B7
80+
#endif
7581

76-
#define COLOR_INACTIVE COLOR_GREY
77-
#define COLOR_COLD COLOR_AQUA
78-
#define COLOR_HOTEND COLOR_SCARLET
79-
#define COLOR_HEATED_BED COLOR_DARK_ORANGE
80-
#define COLOR_CHAMBER COLOR_DARK_ORANGE
81-
#define COLOR_FAN COLOR_AQUA
82+
#ifndef COLOR_INACTIVE
83+
#define COLOR_INACTIVE COLOR_GREY
84+
#endif
85+
#ifndef COLOR_COLD
86+
#define COLOR_COLD COLOR_AQUA
87+
#endif
88+
#ifndef COLOR_HOTEND
89+
#define COLOR_HOTEND COLOR_SCARLET
90+
#endif
91+
#ifndef COLOR_HEATED_BED
92+
#define COLOR_HEATED_BED COLOR_DARK_ORANGE
93+
#endif
94+
#ifndef COLOR_CHAMBER
95+
#define COLOR_CHAMBER COLOR_DARK_ORANGE
96+
#endif
97+
#ifndef COLOR_FAN
98+
#define COLOR_FAN COLOR_AQUA
99+
#endif
82100

83-
#define COLOR_AXIS_HOMED COLOR_WHITE
84-
#define COLOR_AXIS_NOT_HOMED COLOR_YELLOW
101+
#ifndef COLOR_AXIS_HOMED
102+
#define COLOR_AXIS_HOMED COLOR_WHITE
103+
#endif
104+
#ifndef COLOR_AXIS_NOT_HOMED
105+
#define COLOR_AXIS_NOT_HOMED COLOR_YELLOW
106+
#endif
85107

86-
#define COLOR_RATE_100 COLOR_VIVID_GREEN
87-
#define COLOR_RATE_ALTERED COLOR_YELLOW
108+
#ifndef COLOR_RATE_100
109+
#define COLOR_RATE_100 COLOR_VIVID_GREEN
110+
#endif
111+
#ifndef COLOR_RATE_ALTERED
112+
#define COLOR_RATE_ALTERED COLOR_YELLOW
113+
#endif
88114

89-
#define COLOR_PRINT_TIME COLOR_AQUA
115+
#ifndef COLOR_PRINT_TIME
116+
#define COLOR_PRINT_TIME COLOR_AQUA
117+
#endif
90118

91-
#define COLOR_PROGRESS_FRAME COLOR_WHITE
92-
#define COLOR_PROGRESS_BAR COLOR_BLUE
93-
#define COLOR_PROGRESS_BG COLOR_BLACK
119+
#ifndef COLOR_PROGRESS_FRAME
120+
#define COLOR_PROGRESS_FRAME COLOR_WHITE
121+
#endif
122+
#ifndef COLOR_PROGRESS_BAR
123+
#define COLOR_PROGRESS_BAR COLOR_BLUE
124+
#endif
125+
#ifndef COLOR_PROGRESS_BG
126+
#define COLOR_PROGRESS_BG COLOR_BLACK
127+
#endif
94128

95-
#define COLOR_STATUS_MESSAGE COLOR_YELLOW
129+
#ifndef COLOR_STATUS_MESSAGE
130+
#define COLOR_STATUS_MESSAGE COLOR_YELLOW
131+
#endif
96132

97-
#define COLOR_CONTROL_ENABLED COLOR_WHITE
98-
#define COLOR_CONTROL_DISABLED COLOR_GREY
99-
#define COLOR_CONTROL_CANCEL COLOR_SCARLET
100-
#define COLOR_CONTROL_CONFIRM COLOR_VIVID_GREEN
101-
#define COLOR_BUSY COLOR_SILVER
133+
#ifndef COLOR_CONTROL_ENABLED
134+
#define COLOR_CONTROL_ENABLED COLOR_WHITE
135+
#endif
136+
#ifndef COLOR_CONTROL_DISABLED
137+
#define COLOR_CONTROL_DISABLED COLOR_GREY
138+
#endif
139+
#ifndef COLOR_CONTROL_CANCEL
140+
#define COLOR_CONTROL_CANCEL COLOR_SCARLET
141+
#endif
142+
#ifndef COLOR_CONTROL_CONFIRM
143+
#define COLOR_CONTROL_CONFIRM COLOR_VIVID_GREEN
144+
#endif
145+
#ifndef COLOR_BUSY
146+
#define COLOR_BUSY COLOR_SILVER
147+
#endif
102148

103-
#define COLOR_MENU_TEXT COLOR_YELLOW
104-
#define COLOR_MENU_VALUE COLOR_WHITE
149+
#ifndef COLOR_MENU_TEXT
150+
#define COLOR_MENU_TEXT COLOR_YELLOW
151+
#endif
152+
#ifndef COLOR_MENU_VALUE
153+
#define COLOR_MENU_VALUE COLOR_WHITE
154+
#endif
105155

106-
#define COLOR_SLIDER COLOR_WHITE
107-
#define COLOR_SLIDER_INACTIVE COLOR_GREY
156+
#ifndef COLOR_SLIDER
157+
#define COLOR_SLIDER COLOR_WHITE
158+
#endif
159+
#ifndef COLOR_SLIDER_INACTIVE
160+
#define COLOR_SLIDER_INACTIVE COLOR_GREY
161+
#endif
108162

109-
#define COLOR_UBL COLOR_WHITE
163+
#ifndef COLOR_UBL
164+
#define COLOR_UBL COLOR_WHITE
165+
#endif
110166

111-
#define COLOR_TOUCH_CALIBRATION COLOR_WHITE
167+
#ifndef COLOR_TOUCH_CALIBRATION
168+
#define COLOR_TOUCH_CALIBRATION COLOR_WHITE
169+
#endif
112170

113-
#define COLOR_KILL_SCREEN_BG COLOR_MAROON
114-
#define COLOR_KILL_SCREEN_TEXT COLOR_WHITE
171+
#ifndef COLOR_KILL_SCREEN_BG
172+
#define COLOR_KILL_SCREEN_BG COLOR_MAROON
173+
#endif
174+
#ifndef COLOR_KILL_SCREEN_TEXT
175+
#define COLOR_KILL_SCREEN_TEXT COLOR_WHITE
176+
#endif

0 commit comments

Comments
 (0)