瀏覽代碼

Allow ColorUI color customization (#19484)

Victor Oliveira 3 年之前
父節點
當前提交
5cf2cf2be9
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 92 行新增30 行删除
  1. 92
    30
      Marlin/src/lcd/tft/tft_color.h

+ 92
- 30
Marlin/src/lcd/tft/tft_color.h 查看文件

@@ -21,6 +21,8 @@
21 21
  */
22 22
 #pragma once
23 23
 
24
+#include "../../inc/MarlinConfigPre.h"
25
+
24 26
 #define RED(color)            ((color >> 8) & 0xF8)
25 27
 #define GREEN(color)          ((color >> 3) & 0xFC)
26 28
 #define BLUE(color)           ((color << 3) & 0xF8)
@@ -70,45 +72,105 @@
70 72
 #ifndef COLOR_BACKGROUND
71 73
   #define COLOR_BACKGROUND    0x20AC  // #1E156E
72 74
 #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
75 81
 
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
82 100
 
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
85 107
 
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
88 114
 
89
-#define COLOR_PRINT_TIME        COLOR_AQUA
115
+#ifndef COLOR_PRINT_TIME
116
+	#define COLOR_PRINT_TIME        COLOR_AQUA
117
+#endif
90 118
 
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
94 128
 
95
-#define COLOR_STATUS_MESSAGE    COLOR_YELLOW
129
+#ifndef COLOR_STATUS_MESSAGE
130
+	#define COLOR_STATUS_MESSAGE    COLOR_YELLOW
131
+#endif
96 132
 
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
102 148
 
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
105 155
 
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
108 162
 
109
-#define COLOR_UBL               COLOR_WHITE
163
+#ifndef COLOR_UBL
164
+	#define COLOR_UBL               COLOR_WHITE
165
+#endif
110 166
 
111
-#define COLOR_TOUCH_CALIBRATION COLOR_WHITE
167
+#ifndef COLOR_TOUCH_CALIBRATION
168
+	#define COLOR_TOUCH_CALIBRATION COLOR_WHITE
169
+#endif
112 170
 
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

Loading…
取消
儲存