From a5ced35efc0979ac962ac4e9179238fefc6af617 Mon Sep 17 00:00:00 2001
From: "Matthew M. Burke" <matthew@bluedino.net>
Date: Wed, 12 Jul 2017 20:47:42 -0400
Subject: [PATCH] added getColor function

---
 OLEDDisplay.cpp | 4 ++++
 OLEDDisplay.h   | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/OLEDDisplay.cpp b/OLEDDisplay.cpp
index f8fc226..238c37f 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 81537a2..6931001 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);
 
-- 
GitLab