|
|
@@ -124,7 +124,14 @@ class GxEPD2Display : public display::DisplayBuffer {
|
|
|
if (color.red > color.green && color.red > color.blue && color.red > 0x7f) {
|
|
|
this->driver_->drawPixel(x, y, GxEPD_RED);
|
|
|
} else {
|
|
|
- this->driver_->drawPixel(x, y, color.is_on() ? GxEPD_BLACK : GxEPD_WHITE);
|
|
|
+ // get_display_type() reports DISPLAY_TYPE_COLOR for this mode, so
|
|
|
+ // callers draw with literal RGB colors (Color(255,255,255,...) for
|
|
|
+ // white, Color(0,0,0,...) for black) - not the on/off convention
|
|
|
+ // is_on() (raw_32 != 0) assumes, which is only correct for the BW
|
|
|
+ // path above (DISPLAY_TYPE_BINARY). Using is_on() here inverted
|
|
|
+ // black and white for any lambda drawing literal colors.
|
|
|
+ bool bright = color.red > 0x7f || color.green > 0x7f || color.blue > 0x7f;
|
|
|
+ this->driver_->drawPixel(x, y, bright ? GxEPD_WHITE : GxEPD_BLACK);
|
|
|
}
|
|
|
} else {
|
|
|
uint16_t rgb565 = ((color.red & 0xF8) << 8) | ((color.green & 0xFC) << 3) | (color.blue >> 3);
|