1919
2020#define TAG " CustomLcdDisplay"
2121
22- // Color definitions for dark theme
23- #define DARK_BACKGROUND_COLOR lv_color_hex (0x121212 ) // Dark background
24- #define DARK_TEXT_COLOR lv_color_white () // White text
25- #define DARK_CHAT_BACKGROUND_COLOR lv_color_hex (0x1E1E1E ) // Slightly lighter than background
26- #define DARK_USER_BUBBLE_COLOR lv_color_hex (0x1A6C37 ) // Dark green
27- #define DARK_ASSISTANT_BUBBLE_COLOR lv_color_hex (0x333333 ) // Dark gray
28- #define DARK_SYSTEM_BUBBLE_COLOR lv_color_hex (0x2A2A2A ) // Medium gray
29- #define DARK_SYSTEM_TEXT_COLOR lv_color_hex (0xAAAAAA ) // Light gray text
30- #define DARK_BORDER_COLOR lv_color_hex (0x333333 ) // Dark gray border
31- #define DARK_LOW_BATTERY_COLOR lv_color_hex (0xFF0000 ) // Red for dark mode
32-
33- // Color definitions for light theme
34- #define LIGHT_BACKGROUND_COLOR lv_color_white () // White background
35- #define LIGHT_TEXT_COLOR lv_color_black () // Black text
36- #define LIGHT_CHAT_BACKGROUND_COLOR lv_color_hex (0xE0E0E0 ) // Light gray background
37- #define LIGHT_USER_BUBBLE_COLOR lv_color_hex (0x95EC69 ) // WeChat green
38- #define LIGHT_ASSISTANT_BUBBLE_COLOR lv_color_white () // White
39- #define LIGHT_SYSTEM_BUBBLE_COLOR lv_color_hex (0xE0E0E0 ) // Light gray
40- #define LIGHT_SYSTEM_TEXT_COLOR lv_color_hex (0x666666 ) // Dark gray text
41- #define LIGHT_BORDER_COLOR lv_color_hex (0xE0E0E0 ) // Light gray border
42- #define LIGHT_LOW_BATTERY_COLOR lv_color_black () // Black for light mode
43-
44- // Define dark theme colors
45- static const ThemeColors DARK_THEME = {
46- .background = DARK_BACKGROUND_COLOR,
47- .text = DARK_TEXT_COLOR,
48- .chat_background = DARK_CHAT_BACKGROUND_COLOR,
49- .user_bubble = DARK_USER_BUBBLE_COLOR,
50- .assistant_bubble = DARK_ASSISTANT_BUBBLE_COLOR,
51- .system_bubble = DARK_SYSTEM_BUBBLE_COLOR,
52- .system_text = DARK_SYSTEM_TEXT_COLOR,
53- .border = DARK_BORDER_COLOR,
54- .low_battery = DARK_LOW_BATTERY_COLOR
55- };
56-
57- // Define light theme colors
58- static const ThemeColors LIGHT_THEME = {
59- .background = LIGHT_BACKGROUND_COLOR,
60- .text = LIGHT_TEXT_COLOR,
61- .chat_background = LIGHT_CHAT_BACKGROUND_COLOR,
62- .user_bubble = LIGHT_USER_BUBBLE_COLOR,
63- .assistant_bubble = LIGHT_ASSISTANT_BUBBLE_COLOR,
64- .system_bubble = LIGHT_SYSTEM_BUBBLE_COLOR,
65- .system_text = LIGHT_SYSTEM_TEXT_COLOR,
66- .border = LIGHT_BORDER_COLOR,
67- .low_battery = LIGHT_LOW_BATTERY_COLOR
68- };
69-
70- // Current theme - initialize based on default config
71- static ThemeColors current_theme = LIGHT_THEME;
7222
7323static SemaphoreHandle_t trans_done_sem = NULL ;
7424static uint16_t *trans_act;
@@ -331,12 +281,6 @@ CustomLcdDisplay::CustomLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_p
331281 lv_display_set_offset (display_, offset_x, offset_y);
332282 }
333283
334- // Update the theme
335- if (current_theme_name_ == " dark" ) {
336- current_theme = DARK_THEME;
337- } else if (current_theme_name_ == " light" ) {
338- current_theme = LIGHT_THEME;
339- }
340284
341285 SetupUI ();
342286}
0 commit comments