From d3bd93e1075b3a73289ddc39cbb09d01ad126e54 Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 01:00:09 +0200 Subject: [PATCH 1/8] declare _color in E290Display.h --- src/helpers/ui/E290Display.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/helpers/ui/E290Display.h b/src/helpers/ui/E290Display.h index 2ca50225d1..b299efd963 100644 --- a/src/helpers/ui/E290Display.h +++ b/src/helpers/ui/E290Display.h @@ -13,6 +13,7 @@ class E290Display : public DisplayDriver { EInkDisplay_VisionMasterE290 display; bool _init = false; bool _isOn = false; + uint8_t _color; RefCountedDigitalPin* _periph_power; CRC32 display_crc; uint32_t last_display_crc_value = 0; From 87a0cd2a1df0650cf21217bce26f4cf8c777831e Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 01:00:30 +0200 Subject: [PATCH 2/8] uint8_t _color; E213Display.h --- src/helpers/ui/E213Display.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/helpers/ui/E213Display.h b/src/helpers/ui/E213Display.h index 420792c8a3..fbd01b03bf 100644 --- a/src/helpers/ui/E213Display.h +++ b/src/helpers/ui/E213Display.h @@ -13,6 +13,7 @@ class E213Display : public DisplayDriver { BaseDisplay* display=NULL; bool _init = false; bool _isOn = false; + uint8_t _color; RefCountedDigitalPin* _periph_power; CRC32 display_crc; uint32_t last_display_crc_value = 0; From 0533ad0d87f02352782394784cf5bbec49a2199e Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 01:18:44 +0200 Subject: [PATCH 3/8] fix colors in E290Display.cpp --- src/helpers/ui/E290Display.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/helpers/ui/E290Display.cpp b/src/helpers/ui/E290Display.cpp index ef4df05ed7..bf48ddfa5f 100644 --- a/src/helpers/ui/E290Display.cpp +++ b/src/helpers/ui/E290Display.cpp @@ -81,7 +81,9 @@ void E290Display::setTextSize(int sz) { void E290Display::setColor(Color c) { display_crc.update(c); - // implemented in individual display methods + _color = c == 0 ? WHITE : BLACK; // for rectangles + display.setTextColor(UINT16_MAX * _color); // for text + // keep in mind this is inverted on e-ink } void E290Display::setCursor(int x, int y) { @@ -100,7 +102,7 @@ void E290Display::fillRect(int x, int y, int w, int h) { display_crc.update(y); display_crc.update(w); display_crc.update(h); - display.fillRect(x, y, w, h, BLACK); + display.fillRect(x, y, w, h, _color); } void E290Display::drawRect(int x, int y, int w, int h) { @@ -108,7 +110,7 @@ void E290Display::drawRect(int x, int y, int w, int h) { display_crc.update(y); display_crc.update(w); display_crc.update(h); - display.drawRect(x, y, w, h, BLACK); + display.drawRect(x, y, w, h, _color); } void E290Display::drawXbm(int x, int y, const uint8_t *bits, int w, int h) { From ba05f6e8886cfb8df85314964fde6721dfbaeefd Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 01:23:39 +0200 Subject: [PATCH 4/8] fix colors in E213Display.cpp --- src/helpers/ui/E213Display.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/helpers/ui/E213Display.cpp b/src/helpers/ui/E213Display.cpp index 814693a06b..42ce51cf7b 100644 --- a/src/helpers/ui/E213Display.cpp +++ b/src/helpers/ui/E213Display.cpp @@ -128,7 +128,9 @@ void E213Display::setTextSize(int sz) { void E213Display::setColor(Color c) { display_crc.update(c); - // implemented in individual display methods + _color = c == 0 ? WHITE : BLACK; // for rectangles + display.setTextColor(UINT16_MAX * _color); // for text + // keep in mind this is inverted on e-ink } void E213Display::setCursor(int x, int y) { @@ -147,7 +149,7 @@ void E213Display::fillRect(int x, int y, int w, int h) { display_crc.update(y); display_crc.update(w); display_crc.update(h); - display->fillRect(x, y, w, h, BLACK); + display->fillRect(x, y, w, h, _color); } void E213Display::drawRect(int x, int y, int w, int h) { @@ -155,7 +157,7 @@ void E213Display::drawRect(int x, int y, int w, int h) { display_crc.update(y); display_crc.update(w); display_crc.update(h); - display->drawRect(x, y, w, h, BLACK); + display->drawRect(x, y, w, h, _color); } void E213Display::drawXbm(int x, int y, const uint8_t *bits, int w, int h) { From 7396252e81a75bef834709df9f2c1983805a3d86 Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 15:39:47 +0200 Subject: [PATCH 5/8] fix bitmap color drawing in E213Display.cpp --- src/helpers/ui/E213Display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/ui/E213Display.cpp b/src/helpers/ui/E213Display.cpp index 42ce51cf7b..e8d76b166f 100644 --- a/src/helpers/ui/E213Display.cpp +++ b/src/helpers/ui/E213Display.cpp @@ -181,7 +181,7 @@ void E213Display::drawXbm(int x, int y, const uint8_t *bits, int w, int h) { // If the bit is set, draw the pixel if (bitSet) { - display->drawPixel(x + bx, y + by, BLACK); + display->drawPixel(x + bx, y + by, _color); } } } From e87edd8c0176379a0886a176e1d516fd4b1830f0 Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 15:43:32 +0200 Subject: [PATCH 6/8] fix bitmap color drawing in E290Display.cpp --- src/helpers/ui/E290Display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/ui/E290Display.cpp b/src/helpers/ui/E290Display.cpp index bf48ddfa5f..8482c9ba05 100644 --- a/src/helpers/ui/E290Display.cpp +++ b/src/helpers/ui/E290Display.cpp @@ -134,7 +134,7 @@ void E290Display::drawXbm(int x, int y, const uint8_t *bits, int w, int h) { // If the bit is set, draw the pixel if (bitSet) { - display.drawPixel(x + bx, y + by, BLACK); + display.drawPixel(x + bx, y + by, _color); } } } From 51dba091b2401e1e803b1002c496874032575bf5 Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 16:04:14 +0200 Subject: [PATCH 7/8] Update comment in E290Display.cpp --- src/helpers/ui/E290Display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/ui/E290Display.cpp b/src/helpers/ui/E290Display.cpp index 8482c9ba05..8c7f4ab4b6 100644 --- a/src/helpers/ui/E290Display.cpp +++ b/src/helpers/ui/E290Display.cpp @@ -81,7 +81,7 @@ void E290Display::setTextSize(int sz) { void E290Display::setColor(Color c) { display_crc.update(c); - _color = c == 0 ? WHITE : BLACK; // for rectangles + _color = c == 0 ? WHITE : BLACK; // for rectangles and bitmaps display.setTextColor(UINT16_MAX * _color); // for text // keep in mind this is inverted on e-ink } From 16b502f349590c321ae5cbe5310b3d8951dfaa33 Mon Sep 17 00:00:00 2001 From: mattazzu <84230942+doormatt-dev@users.noreply.github.com> Date: Thu, 14 May 2026 16:04:50 +0200 Subject: [PATCH 8/8] Update comment in E213Display.cpp --- src/helpers/ui/E213Display.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/ui/E213Display.cpp b/src/helpers/ui/E213Display.cpp index e8d76b166f..6071528202 100644 --- a/src/helpers/ui/E213Display.cpp +++ b/src/helpers/ui/E213Display.cpp @@ -128,7 +128,7 @@ void E213Display::setTextSize(int sz) { void E213Display::setColor(Color c) { display_crc.update(c); - _color = c == 0 ? WHITE : BLACK; // for rectangles + _color = c == 0 ? WHITE : BLACK; // for rectangles and bitmaps display.setTextColor(UINT16_MAX * _color); // for text // keep in mind this is inverted on e-ink }