Skip to content

Commit

Permalink
🎨 Clean up TFT Colors (MarlinFirmware#26050)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisiskeithb authored and Andy-Big committed Jul 20, 2023
1 parent b1543d5 commit b4900d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
6 changes: 2 additions & 4 deletions Marlin/src/lcd/dogm/u8g_dev_tft_upscale_from_128x64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ TFT_IO tftio;
#define X_HI (UPSCALE(TFT_PIXEL_OFFSET_X, WIDTH) - 1)
#define Y_HI (UPSCALE(TFT_PIXEL_OFFSET_Y, HEIGHT) - 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
// RGB565 color picker: https://embeddednotepad.com/page/rgb565-color-picker
// Hex code to color name: https://www.color-name.com/

#define COLOR_BLACK 0x0000 // #000000
#define COLOR_WHITE 0xFFFF // #FFFFFF
Expand All @@ -104,9 +104,7 @@ TFT_IO tftio;
#define COLOR_BLUE 0x001F // #0000FF
#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_MAROON 0x7800 // #800000
#define COLOR_GREEN 0x03E0 // #008000
Expand Down
18 changes: 8 additions & 10 deletions Marlin/src/lcd/tft/tft_color.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#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
// RGB565 color picker: https://embeddednotepad.com/page/rgb565-color-picker
// Hex code to color name: https://www.color-name.com/

#define COLOR_BLACK 0x0000 // #000000
#define COLOR_WHITE 0xFFFF // #FFFFFF
Expand All @@ -44,13 +44,13 @@
#define COLOR_RED 0xF800 // #FF0000
#define COLOR_SCARLET 0xF904 // #FF2020
#define COLOR_LIME 0x7E00 // #00FF00
#define COLOR_MIDNIGHT_BLUE 0x20AC // #1E156E
#define COLOR_BLUE 0x001F // #0000FF
#define COLOR_OCEAN_BOAT_BLUE 0x03B7 // #0075BD
#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

Expand All @@ -68,17 +68,15 @@
#define COLOR_DARK_ORANGE 0xFC40 // #FF8C00
#define COLOR_CORAL_RED 0xF9E7 // #FF3F3F

#define COLOR_DARK_PURPLE 0x9930 // #992380

#ifndef COLOR_BACKGROUND
// #define COLOR_BACKGROUND 0x20AC // #1E156E
// #define COLOR_BACKGROUND COLOR_MIDNIGHT_BLUE // #1E156E
#define COLOR_BACKGROUND 0x0000 // #000000
#endif
#ifndef COLOR_SELECTION_BG
#define COLOR_SELECTION_BG 0x9930 // #992380
#define COLOR_SELECTION_BG COLOR_DARK_PURPLE
#endif
#ifndef COLOR_WEBSITE_URL
#define COLOR_WEBSITE_URL 0x03B7 // #0075BD
#define COLOR_WEBSITE_URL COLOR_OCEAN_BOAT_BLUE
#endif

#ifndef COLOR_TEMP_TEXT
Expand Down Expand Up @@ -147,7 +145,7 @@
#endif

#ifndef COLOR_PRINT_TIME
#define COLOR_PRINT_TIME COLOR_AQUA
#define COLOR_PRINT_TIME COLOR_CYAN
#endif

#ifndef COLOR_PROGRESS_FRAME
Expand Down

0 comments on commit b4900d5

Please sign in to comment.