From 9d58a880cdad65d847fe7b7fe0e6981ba73a7731 Mon Sep 17 00:00:00 2001 From: DvoraNoob <62312359+DvoraNoob@users.noreply.github.com> Date: Sun, 30 May 2021 13:36:05 -0300 Subject: [PATCH 1/3] Add files via upload --- Marlin/Configuration.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 366267aa7e97..7891b29898a8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -102,7 +102,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 0 +#define SERIAL_PORT 1 /** * Serial Port Baud Rate @@ -2552,6 +2552,13 @@ //#define TFT_COLOR_UI //#define TFT_LVGL_UI +//Theme +#if ENABLED (TFT_COLOR_UI) + //#define MARLIN_UI + //#define DARK_UI + //#define WHITE_UI +#endif + #if ENABLED(TFT_LVGL_UI) //#define MKS_WIFI_MODULE // MKS WiFi module #endif From 707f77661ca7632810cfda7b681d2de55da17ed1 Mon Sep 17 00:00:00 2001 From: DvoraNoob <62312359+DvoraNoob@users.noreply.github.com> Date: Sun, 30 May 2021 13:40:20 -0300 Subject: [PATCH 2/3] Add files via upload --- Marlin/src/lcd/tft/tft.h | 2 +- Marlin/src/lcd/tft/tft_color.h | 412 +++++++++++++++++++++++------ Marlin/src/lcd/tft/ui_1024x600.cpp | 21 +- Marlin/src/lcd/tft/ui_320x240.cpp | 17 +- Marlin/src/lcd/tft/ui_480x320.cpp | 17 +- Marlin/src/lcd/tft/ui_common.cpp | 2 +- 6 files changed, 359 insertions(+), 112 deletions(-) diff --git a/Marlin/src/lcd/tft/tft.h b/Marlin/src/lcd/tft/tft.h index 1576518b4bb7..36f04d5c991e 100644 --- a/Marlin/src/lcd/tft/tft.h +++ b/Marlin/src/lcd/tft/tft.h @@ -96,7 +96,7 @@ class TFT { static inline void add_text(uint16_t x, uint16_t y, uint16_t color, TFT_String tft_string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, tft_string.string(), maxWidth); } static inline void add_text(uint16_t x, uint16_t y, uint16_t color, const char *string, uint16_t maxWidth = 0) { queue.add_text(x, y, color, (uint8_t *)string, maxWidth); } static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t *colors) { queue.add_image(x, y, image, colors); } - static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = COLOR_WHITE, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_BLACK) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } + static inline void add_image(int16_t x, int16_t y, MarlinImage image, uint16_t color_main = MAIN_COLOR, uint16_t color_background = COLOR_BACKGROUND, uint16_t color_shadow = COLOR_SHADOW) { queue.add_image(x, y, image, color_main, color_background, color_shadow); } static inline void add_bar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_bar(x, y, width, height, color); } static inline void add_rectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { queue.add_rectangle(x, y, width, height, color); } static void draw_edit_screen_buttons(); diff --git a/Marlin/src/lcd/tft/tft_color.h b/Marlin/src/lcd/tft/tft_color.h index a8668179e579..c52db02f1bb8 100644 --- a/Marlin/src/lcd/tft/tft_color.h +++ b/Marlin/src/lcd/tft/tft_color.h @@ -30,151 +30,413 @@ #define COLOR(color) RGB(((color >> 16) & 0xFF), ((color >> 8) & 0xFF), (color & 0xFF)) #define HALF(color) RGB(RED(color) >> 1, GREEN(color) >> 1, BLUE(color) >> 1) -// 16 bit color generator: https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html -// RGB565 color picker: https://trolsoft.ru/en/articles/rgb565-color-picker - -#define COLOR_BLACK 0x0000 // #000000 -#define COLOR_WHITE 0xFFFF // #FFFFFF -#define COLOR_SILVER 0xC618 // #C0C0C0 -#define COLOR_GREY 0x7BEF // #808080 -#define COLOR_DARKGREY 0x4208 // #404040 -#define COLOR_DARKGREY2 0x39E7 // #303030 -#define COLOR_DARK 0x0003 // #000019 - -#define COLOR_RED 0xF800 // #FF0000 -#define COLOR_SCARLET 0xF904 // #FF2020 -#define COLOR_LIME 0x7E00 // #00FF00 -#define COLOR_BLUE 0x001F // #0000FF -#define COLOR_LIGHT_BLUE 0x061F // #00C3FF -#define COLOR_YELLOW 0xFFE0 // #FFFF00 -#define COLOR_MAGENTA 0xF81F // #FF00FF -#define COLOR_FUCHSIA 0xF81F // #FF00FF -#define COLOR_CYAN 0x07FF // #00FFFF -#define COLOR_AQUA 0x07FF // #00FFFF -#define COLOR_DODGER_BLUE 0x041F // #0080FF -#define COLOR_VIVID_VIOLET 0x7933 // #772399 - -#define COLOR_DARK_PURPLE 0x9930 // #992380 - -#define COLOR_MAROON 0x7800 // #800000 -#define COLOR_GREEN 0x03E0 // #008000 -#define COLOR_NAVY 0x000F // #000080 -#define COLOR_OLIVE 0x8400 // #808000 -#define COLOR_PURPLE 0x8010 // #800080 -#define COLOR_TEAL 0x0410 // #008080 - -#define COLOR_ORANGE 0xFC00 // #FF7F00 -#define COLOR_VIVID_GREEN 0x7FE0 // #7FFF00 -#define COLOR_DARK_ORANGE 0xFC40 // #FF8C00 -#define COLOR_CORAL_RED 0xF9E7 // #FF3F3F - -#define COLOR_DARK_PURPLE 0x9930 // #992380 +// see https://ee-programming-notepad.blogspot.com/2016/10/16-bit-color-generator-picker.html +#define COLOR_DARKGREY 0x4208 //#404040 DEFAULT + +#define C_BLACK 0x0000 //#000000 DEFAULT +#define C_DARK_PLUS_GREY 0x3186 //#323232 +#define C_DARK_GREY 0x7BEF //#808080 DEFAULT +#define C_GREY 0x7C0F //#828282 +#define C_MEDIUM_GREY 0xBDD7 //#BEBEBE +#define C_SILVER 0xC618 //#C0C0C0 DEFAULT +#define C_LIGHT_GREY 0xCE79 //#D0D0D0 +#define C_WHITE 0xFFFF //#FFFFFF DEFAULT + +#define C_MARRON 0x7800 //#800000 DEFAULT +#define C_DARK_PLUS_RED 0x9945 //#A02C2D +#define C_DARK_RED 0xE121 //#FF280A +#define C_SCARLET 0xF904 //#FF2020 DEFAULT +#define C_RED 0xF800 //#FF0000 DEFAULT +#define C_CORAL_RED 0xF9E7 //#FF3F3F DEFAULT + +#define C_LIGHT_PINK 0xFC13 //#FF82A0 +#define C_DARK_PURPLE 0x9930 //#A02787 DEFAULT +#define C_PURPLE 0xE12D //#323232 + +#define C_DARK_BLUE 0x20AC //#1E156E DEFAULT +#define C_BLUE 0x001F //#0000FF DEFAULT +#define C_LIGHT_BLUE 0x03B7 //#0078BE DEFAULT +#define C_LIGHT_BLUE2 0x061F //#00C3FF DEFAULT +#define C_PASTEL_BLUE 0x6E1A //#6EC3DC +#define C_AQUA 0x07FF //#00FFFF DEFAULT + +#define C_DARK_GREEN 0x0560 //#00AF00 +#define C_PASTEL_GREEN 0x6706 //#64E632 +#define C_GREEN 0x07E0 //#00FF00 +#define C_LIGHT_GREEN 0x7FE0 //#82FF00 DEFAULT + +#define C_GOLD 0xFE40 //#FFCD00 +#define C_YELLOW 0xFFE0 //#FFFF00 DEFAULT +#define C_LIGHT_YELLOW 0xE7EA //#EBFF55 + +#define C_ORANGE 0xFBE0 //#FF8000 +#define C_LIGHT_ORANGE 0xFC40 //#FF8C00 DEFAULT + +//Main Color +#ifndef MAIN_COLOR + #define MAIN_COLOR C_WHITE +#endif + +//Shadow Color +#ifndef COLOR_SHADOW + #if ENABLED(MARLIN_UI) + #define COLOR_SHADOW C_BLACK + #elif ENABLED(DARK_UI) + #define COLOR_SHADOW C_BLACK + #elif ENABLED(WHITE_UI) + #define COLOR_SHADOW C_WHITE + #endif +#endif + +//Marlin BG Color #ifndef COLOR_BACKGROUND - #define COLOR_BACKGROUND 0x20AC // #1E156E + #if ENABLED(MARLIN_UI) + #define COLOR_BACKGROUND C_DARK_BLUE + #elif ENABLED(DARK_UI) + #define COLOR_BACKGROUND C_DARK_PLUS_GREY + #elif ENABLED(WHITE_UI) + #define COLOR_BACKGROUND C_WHITE + #endif #endif -#ifndef COLOR_SELECTION_BG - #define COLOR_SELECTION_BG 0x9930 // #992380 + +//Hover Color +#ifndef COLOR_SELECTION_BG + #if ENABLED(MARLIN_UI) + #define COLOR_SELECTION_BG C_DARK_PURPLE + #elif ENABLED(DARK_UI) + #define COLOR_SELECTION_BG C_DARK_GREY + #elif ENABLED(WHITE_UI) + #define COLOR_SELECTION_BG C_SILVER + #endif #endif + +//Link Color #ifndef COLOR_WEBSITE_URL - #define COLOR_WEBSITE_URL 0x03B7 // #0075BD + #if ENABLED(MARLIN_UI) + #define COLOR_WEBSITE_URL C_LIGHT_BLUE + #elif ENABLED(DARK_UI) + #define COLOR_WEBSITE_URL C_PASTEL_GREEN + #elif ENABLED(WHITE_UI) + #define COLOR_WEBSITE_URL C_PASTEL_GREEN + #endif #endif +//Off icons Color #ifndef COLOR_INACTIVE - #define COLOR_INACTIVE COLOR_GREY + #if ENABLED(White_UI) + #define COLOR_INACTIVE C_DARK_GREY + #else + #define COLOR_INACTIVE C_LIGHT_GREY + #endif #endif + +//Cold Icons Color #ifndef COLOR_COLD - #define COLOR_COLD COLOR_AQUA + #if ENABLED(MARLIN_UI) + #define COLOR_COLD C_AQUA + #elif ENABLED(DARK_UI) + #define COLOR_COLD C_PASTEL_BLUE + #elif ENABLED(WHITE_UI) + #define COLOR_COLD C_BLUE + #endif #endif + +//Heated Hotend Color #ifndef COLOR_HOTEND - #define COLOR_HOTEND COLOR_SCARLET + #if ENABLED(MARLIN_UI) + #define COLOR_HOTEND C_SCARLET + #elif ENABLED(DARK_UI) + #define COLOR_HOTEND C_DARK_RED + #elif ENABLED(WHITE_UI) + #define COLOR_HOTEND C_RED + #endif #endif + +//Heated BED Color #ifndef COLOR_HEATED_BED - #define COLOR_HEATED_BED COLOR_DARK_ORANGE + #if ENABLED(MARLIN_UI) + #define COLOR_HEATED_BED C_LIGHT_ORANGE + #elif ENABLED(DARK_UI) + #define COLOR_HEATED_BED C_ORANGE + #elif ENABLED(WHITE_UI) + #define COLOR_HEATED_BED C_ORANGE + #endif #endif + +//Chamber Color #ifndef COLOR_CHAMBER - #define COLOR_CHAMBER COLOR_DARK_ORANGE -#endif -#ifndef COLOR_COOLER - #define COLOR_COOLER COLOR_DARK_ORANGE + #if ENABLED(MARLIN_UI) + #define COLOR_CHAMBER C_LIGHT_ORANGE + #elif ENABLED(DARK_UI) + #define COLOR_CHAMBER C_ORANGE + #elif ENABLED(WHITE_UI) + #define COLOR_CHAMBER C_ORANGE + #endif #endif + +//Fan Color #ifndef COLOR_FAN - #define COLOR_FAN COLOR_AQUA + #if ENABLED(MARLIN_UI) + #define COLOR_FAN C_AQUA + #elif ENABLED(DARK_UI) + #define COLOR_FAN C_PASTEL_BLUE + #elif ENABLED(WHITE_UI) + #define COLOR_FAN C_BLUE + #endif #endif +//Home Position Color #ifndef COLOR_AXIS_HOMED - #define COLOR_AXIS_HOMED COLOR_WHITE + #if ENABLED(WHITE_UI) + #define COLOR_AXIS_HOMED C_DARK_GREY + #else + #define COLOR_AXIS_HOMED C_WHITE + #endif #endif #ifndef COLOR_AXIS_NOT_HOMED - #define COLOR_AXIS_NOT_HOMED COLOR_YELLOW + #if ENABLED(MARLIN_UI) + #define COLOR_AXIS_NOT_HOMED C_YELLOW + #elif ENABLED(DARK_UI) + #define COLOR_AXIS_NOT_HOMED C_LIGHT_PINK + #elif ENABLED(WHITE_UI) + #define COLOR_AXIS_NOT_HOMED C_LIGHT_PINK + #endif #endif +//Velocity and Flow Color #ifndef COLOR_RATE_100 - #define COLOR_RATE_100 COLOR_VIVID_GREEN + #if ENABLED(MARLIN_UI) + #define COLOR_RATE_100 C_LIGHT_GREEN + #elif ENABLED(DARK_UI) + #define COLOR_RATE_100 C_PASTEL_GREEN + #elif ENABLED(WHITE_UI) + #define COLOR_RATE_100 C_DARK_GREEN + #endif #endif #ifndef COLOR_RATE_ALTERED - #define COLOR_RATE_ALTERED COLOR_YELLOW + #if ENABLED(MARLIN_UI) + #define COLOR_RATE_ALTERED C_YELLOW + #elif ENABLED(DARK_UI) + #define COLOR_RATE_ALTERED C_LIGHT_YELLOW + #elif ENABLED(WHITE_UI) + #define COLOR_RATE_ALTERED C_GOLD + #endif #endif +//Time Color #ifndef COLOR_PRINT_TIME - #define COLOR_PRINT_TIME COLOR_AQUA + #if ENABLED(MARLIN_UI) + #define COLOR_PRINT_TIME C_AQUA + #elif ENABLED(DARK_UI) + #define COLOR_PRINT_TIME C_PASTEL_BLUE + #elif ENABLED(WHITE_UI) + #define COLOR_PRINT_TIME C_BLUE + #endif #endif +// Bar Time Color #ifndef COLOR_PROGRESS_FRAME - #define COLOR_PROGRESS_FRAME COLOR_WHITE + #if ENABLED(MARLIN_UI) + #define COLOR_PROGRESS_FRAME C_WHITE + #elif ENABLED(DARK_UI) + #define COLOR_PROGRESS_FRAME COLOR_BACKGROUND + #elif ENABLED(WHITE_UI) + #define COLOR_PROGRESS_FRAME COLOR_BACKGROUND + #endif #endif #ifndef COLOR_PROGRESS_BAR - #define COLOR_PROGRESS_BAR COLOR_BLUE + #if ENABLED(MARLIN_UI) + #define COLOR_PROGRESS_BAR C_BLUE + #elif ENABLED(DARK_UI) + #define COLOR_PROGRESS_BAR C_PASTEL_BLUE + #elif ENABLED(WHITE_UI) + #define COLOR_PROGRESS_BAR C_BLUE + #endif #endif #ifndef COLOR_PROGRESS_BG - #define COLOR_PROGRESS_BG COLOR_BLACK + #if ENABLED(MARLIN_UI) + #define COLOR_PROGRESS_BG C_BLACK + #elif ENABLED(DARK_UI) + #define COLOR_PROGRESS_BG C_DARK_GREY + #elif ENABLED(WHITE_UI) + #define COLOR_PROGRESS_BG C_LIGHT_GREY + #endif #endif +//Message Color #ifndef COLOR_STATUS_MESSAGE - #define COLOR_STATUS_MESSAGE COLOR_YELLOW + #if ENABLED(MARLIN_UI) + #define COLOR_STATUS_MESSAGE C_YELLOW + #elif ENABLED(DARK_UI) + #define COLOR_STATUS_MESSAGE C_LIGHT_PINK + #elif ENABLED(WHITE_UI) + #define COLOR_STATUS_MESSAGE C_LIGHT_PINK + #endif #endif +//Controls Color #ifndef COLOR_CONTROL_ENABLED - #define COLOR_CONTROL_ENABLED COLOR_WHITE + #if ENABLED(WHITE_UI) + #define COLOR_CONTROL_ENABLED C_DARK_GREY + #else + #define COLOR_CONTROL_ENABLED C_WHITE + #endif #endif #ifndef COLOR_CONTROL_DISABLED - #define COLOR_CONTROL_DISABLED COLOR_GREY + #if ENABLED(WHITE_UI) + #define COLOR_CONTROL_DISABLED C_MEDIUM_GREY + #else + #define COLOR_CONTROL_DISABLED C_DARK_GREY + #endif #endif #ifndef COLOR_CONTROL_CANCEL - #define COLOR_CONTROL_CANCEL COLOR_SCARLET + #if ENABLED(MARLIN_UI) + #define COLOR_CONTROL_CANCEL C_SCARLET + #elif ENABLED(DARK_UI) + #define COLOR_CONTROL_CANCEL C_DARK_RED + #elif ENABLED(WHITE_UI) + #define COLOR_CONTROL_CANCEL C_RED + #endif #endif #ifndef COLOR_CONTROL_CONFIRM - #define COLOR_CONTROL_CONFIRM COLOR_VIVID_GREEN + #if ENABLED(MARLIN_UI) + #define COLOR_CONTROL_CONFIRM C_LIGHT_GREEN + #elif ENABLED(DARK_UI) + #define COLOR_CONTROL_CONFIRM C_PASTEL_GREEN + #elif ENABLED(WHITE_UI) + #define COLOR_CONTROL_CONFIRM C_GREEN + #endif #endif #ifndef COLOR_BUSY - #define COLOR_BUSY COLOR_SILVER + #if ENABLED(WHITE_UI) + #define COLOR_BUSY C_SILVER + #else + #define COLOR_BUSY C_SILVER + #endif #endif +//Text Menu Color #ifndef COLOR_MENU_TEXT - #define COLOR_MENU_TEXT COLOR_YELLOW -#endif + #if ENABLED(MARLIN_UI) + #define COLOR_MENU_TEXT C_YELLOW + #elif ENABLED(DARK_UI) + #define COLOR_MENU_TEXT C_LIGHT_PINK + #elif ENABLED(WHITE_UI) + #define COLOR_MENU_TEXT C_LIGHT_PINK + #endif + #endif #ifndef COLOR_MENU_VALUE - #define COLOR_MENU_VALUE COLOR_WHITE + #if ENABLED(WHITE_UI) + #define COLOR_MENU_VALUE C_DARK_GREY + #else + #define COLOR_MENU_VALUE C_WHITE + #endif #endif +//Slider Color #ifndef COLOR_SLIDER - #define COLOR_SLIDER COLOR_WHITE + #if ENABLED(WHITE_UI) + #define COLOR_SLIDER C_DARK_GREY + #else + #define COLOR_SLIDER C_WHITE + #endif #endif #ifndef COLOR_SLIDER_INACTIVE - #define COLOR_SLIDER_INACTIVE COLOR_GREY + #if ENABLED(WHITE_UI) + #define COLOR_SLIDER_INACTIVE C_LIGHT_GREY + #else + #define COLOR_SLIDER_INACTIVE C_DARK_GREY + #endif #endif +//Color UBL #ifndef COLOR_UBL - #define COLOR_UBL COLOR_WHITE + #if ENABLED(WHITE_UI) + #define COLOR_UBL C_DARK_GREY + #else + #define COLOR_UBL C_WHITE + #endif #endif +//Calibration Color #ifndef COLOR_TOUCH_CALIBRATION - #define COLOR_TOUCH_CALIBRATION COLOR_WHITE + #if ENABLED(WHITE_UI) + #define COLOR_TOUCH_CALIBRATION C_DARK_GREY + #else + #define COLOR_TOUCH_CALIBRATION C_WHITE + #endif #endif +//Error Screen Color #ifndef COLOR_KILL_SCREEN_BG - #define COLOR_KILL_SCREEN_BG COLOR_MAROON + #if ENABLED(MARLIN_UI) + #define COLOR_KILL_SCREEN_BG C_MARRON + #else + #define COLOR_KILL_SCREEN_BG C_DARK_PLUS_RED + #endif #endif #ifndef COLOR_KILL_SCREEN_TEXT - #define COLOR_KILL_SCREEN_TEXT COLOR_WHITE + #define COLOR_KILL_SCREEN_TEXT C_WHITE #endif + +//Submenu axis color +#ifndef E_BTN_COLOR + #if ENABLED(MARLIN_UI) + #define E_BTN_COLOR C_YELLOW + #elif ENABLED(DARK_UI) + #define E_BTN_COLOR C_LIGHT_PINK + #elif ENABLED(WHITE_UI) + #define E_BTN_COLOR C_LIGHT_PINK + #endif +#endif +#ifndef X_BTN_COLOR + #if ENABLED(MARLIN_UI) + #define X_BTN_COLOR C_CORAL_RED + #elif ENABLED(DARK_UI) + #define X_BTN_COLOR C_DARK_RED + #elif ENABLED(WHITE_UI) + #define X_BTN_COLOR C_RED + #endif +#endif +#ifndef Y_BTN_COLOR + #if ENABLED(MARLIN_UI) + #define Y_BTN_COLOR C_LIGHT_GREEN + #elif ENABLED(DARK_UI) + #define Y_BTN_COLOR C_PASTEL_GREEN + #elif ENABLED(WHITE_UI) + #define Y_BTN_COLOR C_DARK_GREEN + #endif +#endif +#ifndef Z_BTN_COLOR + #if ENABLED(MARLIN_UI) + #define Z_BTN_COLOR C_LIGHT_BLUE2 + #elif ENABLED(DARK_UI) + #define Z_BTN_COLOR C_PASTEL_BLUE + #elif ENABLED(WHITE_UI) + #define Z_BTN_COLOR C_BLUE + #endif +#endif +#ifndef OFF_BTN_COLOR + #if ENABLED(WHITE_UI) + #define OFF_BTN_COLOR C_DARK_GREY + #else + #define OFF_BTN_COLOR C_WHITE + #endif +#endif +#ifndef AXIS_MENU_MESSAGE_COLOR + #if ENABLED(MARLIN_UI) + #define AXIS_MENU_MESSAGE_COLOR C_YELLOW + #elif ENABLED(DARK_UI) + #define AXIS_MENU_MESSAGE_COLOR C_LIGHT_YELLOW + #elif ENABLED(WHITE_UI) + #define AXIS_MENU_MESSAGE_COLOR C_GOLD + #endif +#endif +#ifndef COLOR_SHADOW_AXIS + #if ENABLED(WHITE_UI) + #define COLOR_SHADOW_AXIS COLOR_BACKGROUND + #else + #define COLOR_SHADOW_AXIS COLOR_DARKGREY + #endif +#endif \ No newline at end of file diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 631d6d85826c..56f012d07b24 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -173,7 +173,7 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { #if HAS_TEMP_COOLER else if (Heater == H_COOLER) { if (currentTemperature <= 26) Color = COLOR_COLD; - if (currentTemperature > 26) Color = COLOR_RED; + if (currentTemperature > 26) Color = C_RED; image = targetTemperature > 26 ? imgCoolerHot : imgCooler; } #endif @@ -441,13 +441,13 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const if (no) { tft_string.set(no); tft_string.trim(); - tft.add_text(tft_string.center(TFT_WIDTH / 2), 0, !yesno ? COLOR_RED : COLOR_MENU_TEXT, tft_string); + tft.add_text(tft_string.center(TFT_WIDTH / 2), 0, !yesno ? C_RED : COLOR_MENU_TEXT, tft_string); } if (yes) { tft_string.set(yes); tft_string.trim(); - tft.add_text(TFT_WIDTH / 2 + tft_string.center(TFT_WIDTH / 2), 0, yesno ? COLOR_RED : COLOR_MENU_TEXT, tft_string); + tft.add_text(TFT_WIDTH / 2 + tft_string.center(TFT_WIDTH / 2), 0, yesno ? C_RED : COLOR_MENU_TEXT, tft_string); } #endif } @@ -488,7 +488,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.canvas(GRID_OFFSET_X, GRID_OFFSET_Y, GRID_WIDTH, GRID_HEIGHT); tft.set_background(COLOR_BACKGROUND); - tft.add_rectangle(0, 0, GRID_WIDTH, GRID_HEIGHT, COLOR_WHITE); + tft.add_rectangle(0, 0, GRID_WIDTH, GRID_HEIGHT, COLOR_UBL); for (uint16_t x = 0; x < GRID_MAX_POINTS_X ; x++) for (uint16_t y = 0; y < GRID_MAX_POINTS_Y ; y++) @@ -572,11 +572,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 @@ -627,7 +622,7 @@ static void drawCurESelection() { static void drawMessage(const char *msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 34, TFT_HEIGHT / 2, 34); tft.set_background(COLOR_BACKGROUND); - tft.add_text(0, 0, COLOR_YELLOW, msg); + tft.add_text(0, 0, AXIS_MENU_MESSAGE_COLOR, msg); } static void drawAxisValue(const AxisEnum axis) { @@ -793,7 +788,7 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft.canvas(x, y, width, height); tft.set_background(COLOR_BACKGROUND); - tft.add_image(0, 0, imgBtn52Rounded, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); + tft.add_image(0, 0, imgBtn52Rounded, bgColor, COLOR_BACKGROUND, COLOR_SHADOW_AXIS); // TODO: Make an add_text() taking a font arg if (label) { @@ -802,7 +797,7 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft.add_text(tft_string.center(width), height / 2 - tft_string.font_height() / 2, bgColor, tft_string); } else { - tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); + tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_SHADOW_AXIS); } TERN_(TOUCH_SCREEN, if (enabled) touch.add_control(BUTTON, x, y, width, height, data)); @@ -909,7 +904,7 @@ void MarlinUI::move_axis_screen() { } // aligned with x+ - drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (intptr_t)disable_steppers, imgCancel, OFF_BTN_COLOR, !busy); TERN_(TOUCH_SCREEN, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack)); } diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index f7b6ffc75d30..ba27d1173688 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -173,7 +173,7 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { #if HAS_TEMP_COOLER else if (Heater == H_COOLER) { if (currentTemperature <= 26) Color = COLOR_COLD; - if (currentTemperature > 26) Color = COLOR_RED; + if (currentTemperature > 26) Color = C_RED; image = targetTemperature > 26 ? imgCoolerHot : imgCooler; } #endif @@ -469,7 +469,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.canvas(GRID_OFFSET_X, GRID_OFFSET_Y, GRID_WIDTH, GRID_HEIGHT); tft.set_background(COLOR_BACKGROUND); - tft.add_rectangle(0, 0, GRID_WIDTH, GRID_HEIGHT, COLOR_WHITE); + tft.add_rectangle(0, 0, GRID_WIDTH, GRID_HEIGHT, COLOR_UBL); for (uint16_t x = 0; x < (GRID_MAX_POINTS_X); x++) for (uint16_t y = 0; y < (GRID_MAX_POINTS_Y); y++) @@ -553,11 +553,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 48 #define BTN_HEIGHT 39 #define X_MARGIN 15 @@ -612,7 +607,7 @@ static void drawCurESelection() { static void drawMessage(const char *msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 29, (TFT_WIDTH / 2) - (BTN_WIDTH / 2) - X_MARGIN, 20); tft.set_background(COLOR_BACKGROUND); - tft.add_text(0, 0, COLOR_YELLOW, msg); + tft.add_text(0, 0, AXIS_MENU_MESSAGE_COLOR, msg); } static void drawAxisValue(const AxisEnum axis) { @@ -778,7 +773,7 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft.canvas(x, y, width, height); tft.set_background(COLOR_BACKGROUND); - tft.add_image(0, 0, imgBtn39Rounded, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); + tft.add_image(0, 0, imgBtn39Rounded, bgColor, COLOR_BACKGROUND, COLOR_SHADOW_AXIS); // TODO: Make an add_text() taking a font arg if (label) { @@ -787,7 +782,7 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft.add_text(tft_string.center(width), height / 2 - tft_string.font_height() / 2, bgColor, tft_string); } else { - tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); + tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_SHADOW_AXIS); } TERN_(HAS_TFT_XPT2046, if (enabled) touch.add_control(BUTTON, x, y, width, height, data)); @@ -894,7 +889,7 @@ void MarlinUI::move_axis_screen() { } // aligned with x+ - drawBtn(xplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + drawBtn(xplus_x, y, "off", (intptr_t)disable_steppers, imgCancel, OFF_BTN_COLOR, !busy); TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack)); } diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 93df6eb961d0..d4a338540ceb 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -173,7 +173,7 @@ void draw_heater_status(uint16_t x, uint16_t y, const int8_t Heater) { #if HAS_TEMP_COOLER else if (Heater == H_COOLER) { if (currentTemperature <= 26) Color = COLOR_COLD; - if (currentTemperature > 26) Color = COLOR_RED; + if (currentTemperature > 26) Color = C_RED; image = targetTemperature > 26 ? imgCoolerHot : imgCooler; } #endif @@ -475,7 +475,7 @@ void MenuItem_confirm::draw_select_screen(PGM_P const yes, PGM_P const no, const tft.canvas(GRID_OFFSET_X, GRID_OFFSET_Y, GRID_WIDTH, GRID_HEIGHT); tft.set_background(COLOR_BACKGROUND); - tft.add_rectangle(0, 0, GRID_WIDTH, GRID_HEIGHT, COLOR_WHITE); + tft.add_rectangle(0, 0, GRID_WIDTH, GRID_HEIGHT, COLOR_UBL); for (uint16_t x = 0; x < (GRID_MAX_POINTS_X); x++) for (uint16_t y = 0; y < (GRID_MAX_POINTS_Y); y++) @@ -559,11 +559,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 @@ -614,7 +609,7 @@ static void drawCurESelection() { static void drawMessage(const char *msg) { tft.canvas(X_MARGIN, TFT_HEIGHT - Y_MARGIN - 34, TFT_HEIGHT / 2, 34); tft.set_background(COLOR_BACKGROUND); - tft.add_text(0, 0, COLOR_YELLOW, msg); + tft.add_text(0, 0, AXIS_MENU_MESSAGE_COLOR, msg); } static void drawAxisValue(const AxisEnum axis) { @@ -780,7 +775,7 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft.canvas(x, y, width, height); tft.set_background(COLOR_BACKGROUND); - tft.add_image(0, 0, imgBtn52Rounded, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); + tft.add_image(0, 0, imgBtn52Rounded, bgColor, COLOR_BACKGROUND, COLOR_SHADOW_AXIS); // TODO: Make an add_text() taking a font arg if (label) { @@ -789,7 +784,7 @@ static void drawBtn(int x, int y, const char *label, intptr_t data, MarlinImage tft.add_text(tft_string.center(width), height / 2 - tft_string.font_height() / 2, bgColor, tft_string); } else { - tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_DARKGREY); + tft.add_image(0, 0, img, bgColor, COLOR_BACKGROUND, COLOR_SHADOW_AXIS); } TERN_(HAS_TFT_XPT2046, if (enabled) touch.add_control(BUTTON, x, y, width, height, data)); @@ -896,7 +891,7 @@ void MarlinUI::move_axis_screen() { } // aligned with x+ - drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (intptr_t)disable_steppers, imgCancel, COLOR_WHITE, !busy); + drawBtn(xplus_x, TFT_HEIGHT - Y_MARGIN - BTN_HEIGHT, "off", (intptr_t)disable_steppers, imgCancel, OFF_BTN_COLOR, !busy); TERN_(HAS_TFT_XPT2046, add_control(TFT_WIDTH - X_MARGIN - BTN_WIDTH, y, BACK, imgBack)); } diff --git a/Marlin/src/lcd/tft/ui_common.cpp b/Marlin/src/lcd/tft/ui_common.cpp index 7c053e7be711..ca7d72581111 100644 --- a/Marlin/src/lcd/tft/ui_common.cpp +++ b/Marlin/src/lcd/tft/ui_common.cpp @@ -148,7 +148,7 @@ void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t st tft_string.set(pstr, itemIndex, itemString); if (vstr) tft_string.add(vstr); - tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string); + tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, C_YELLOW, tft_string); } #if ENABLED(SDSUPPORT) From 9abd2bd6d0299d25311721b18f87abaef1043ced Mon Sep 17 00:00:00 2001 From: DvoraNoob <62312359+DvoraNoob@users.noreply.github.com> Date: Sun, 30 May 2021 13:50:09 -0300 Subject: [PATCH 3/3] Add files via upload --- Marlin/Configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 7891b29898a8..1949606f4256 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -102,7 +102,7 @@ * * :[-1, 0, 1, 2, 3, 4, 5, 6, 7] */ -#define SERIAL_PORT 1 +#define SERIAL_PORT 0 /** * Serial Port Baud Rate