mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-08-22 18:59:44 +00:00
* refactor of Color mapping in UITasks / DisplayDrivers
* color displays now with a new light theme
This commit is contained in:
@@ -14,6 +14,18 @@
|
||||
SPIClass SPI1 = SPIClass(FSPI);
|
||||
#endif
|
||||
|
||||
// Color scheme
|
||||
ColorVal UIColor::window_bkg = GxEPD_WHITE;
|
||||
ColorVal UIColor::title_bkg = GxEPD_BLACK;
|
||||
ColorVal UIColor::title_txt = GxEPD_WHITE;
|
||||
ColorVal UIColor::primary_txt = GxEPD_BLACK;
|
||||
ColorVal UIColor::secondary_txt = GxEPD_BLACK;
|
||||
ColorVal UIColor::warning_txt = GxEPD_BLACK;
|
||||
ColorVal UIColor::popup_bkg = GxEPD_BLACK;
|
||||
ColorVal UIColor::popup_txt = GxEPD_WHITE;
|
||||
ColorVal UIColor::corp_blue = GxEPD_BLACK;
|
||||
|
||||
|
||||
bool GxEPDDisplay::begin() {
|
||||
display.epd2.selectSPI(SPI1, SPISettings(4000000, MSBFIRST, SPI_MODE0));
|
||||
#ifdef ESP32
|
||||
@@ -61,9 +73,9 @@ void GxEPDDisplay::clear() {
|
||||
display_crc.reset();
|
||||
}
|
||||
|
||||
void GxEPDDisplay::startFrame(Color bkg) {
|
||||
display.fillScreen(GxEPD_WHITE);
|
||||
display.setTextColor(_curr_color = GxEPD_BLACK);
|
||||
void GxEPDDisplay::startFrame(ColorVal bkg) {
|
||||
display.fillScreen(bkg);
|
||||
display.setTextColor(_curr_color = UIColor::primary_txt);
|
||||
display_crc.reset();
|
||||
}
|
||||
|
||||
@@ -85,14 +97,9 @@ void GxEPDDisplay::setTextSize(int sz) {
|
||||
}
|
||||
}
|
||||
|
||||
void GxEPDDisplay::setColor(Color c) {
|
||||
display_crc.update<Color> (c);
|
||||
// colours need to be inverted for epaper displays
|
||||
if (c == DARK) {
|
||||
display.setTextColor(_curr_color = GxEPD_WHITE);
|
||||
} else {
|
||||
display.setTextColor(_curr_color = GxEPD_BLACK);
|
||||
}
|
||||
void GxEPDDisplay::setColor(ColorVal c) {
|
||||
display_crc.update<ColorVal> (c);
|
||||
display.setTextColor(_curr_color = c);
|
||||
}
|
||||
|
||||
void GxEPDDisplay::setCursor(int x, int y) {
|
||||
|
||||
Reference in New Issue
Block a user