diff --git a/OLEDDisplay.cpp b/OLEDDisplay.cpp index f8fc226519b37df85862d0ff3e72bd26a4691eaa..238c37fb7ef98d5fea16975286e0939aee59bf09 100644 --- a/OLEDDisplay.cpp +++ b/OLEDDisplay.cpp @@ -72,6 +72,10 @@ void OLEDDisplay::setColor(OLEDDISPLAY_COLOR color) { this->color = color; } +OLEDDISPLAY_COLOR OLEDDisplay:getColor() { + return this->color; +} + void OLEDDisplay::setPixel(int16_t x, int16_t y) { if (x >= 0 && x < 128 && y >= 0 && y < 64) { switch (color) { diff --git a/OLEDDisplay.h b/OLEDDisplay.h index 81537a24fa54ba017715d4971fb094f6f6b3e791..6931001b3df40d493c2904ac2dfbed2c2ee3c7c1 100644 --- a/OLEDDisplay.h +++ b/OLEDDisplay.h @@ -123,6 +123,9 @@ class OLEDDisplay : public Print { // Sets the color of all pixel operations void setColor(OLEDDISPLAY_COLOR color); + // Returns the current color. + OLEDDISPLAY_COLOR getColor(); + // Draw a pixel at given position void setPixel(int16_t x, int16_t y);