Skip to content

Commit 66a9849

Browse files
#580 global replace color define with RGB565_ prefix
1 parent ba105ed commit 66a9849

File tree

45 files changed

+306
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+306
-305
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, 17 /* RST */);
2626

2727
```C
2828
gfx->begin();
29-
gfx->fillScreen(BLACK);
29+
gfx->fillScreen(RGB565_BLACK);
3030
gfx->setCursor(10, 10);
31-
gfx->setTextColor(RED);
31+
gfx->setTextColor(RGB565_RED);
3232
gfx->println("Hello World!");
3333
```
3434
@@ -87,7 +87,7 @@ Another U8g2 font advantage is the font support Unicode glyphs. Simply enable se
8787
8888
```C
8989
gfx->begin();
90-
gfx->fillScreen(BLACK);
90+
gfx->fillScreen(RGB565_BLACK);
9191
gfx->setUTF8Print(true);
9292
```
9393

examples/ArduinoVNC/ArduinoVNC.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ arduinoVNC vnc = arduinoVNC(vnc_gfx);
9191

9292
void TFTnoWifi(void)
9393
{
94-
gfx->fillScreen(BLACK);
94+
gfx->fillScreen(RGB565_BLACK);
9595
gfx->setCursor(0, ((gfx->height() / 2) - (5 * 8)));
96-
gfx->setTextColor(RED);
96+
gfx->setTextColor(RGB565_RED);
9797
gfx->setTextSize(5);
9898
gfx->println("NO WIFI!");
9999
gfx->setTextSize(2);
@@ -102,9 +102,9 @@ void TFTnoWifi(void)
102102

103103
void TFTnoVNC(void)
104104
{
105-
gfx->fillScreen(BLACK);
105+
gfx->fillScreen(RGB565_BLACK);
106106
gfx->setCursor(0, ((gfx->height() / 2) - (4 * 8)));
107-
gfx->setTextColor(GREEN);
107+
gfx->setTextColor(RGB565_GREEN);
108108
gfx->setTextSize(4);
109109
gfx->println("connect VNC");
110110
gfx->setTextSize(2);
@@ -186,7 +186,7 @@ void setup(void)
186186
{
187187
Serial.println("gfx->begin() failed!");
188188
}
189-
gfx->fillScreen(BLACK);
189+
gfx->fillScreen(RGB565_BLACK);
190190

191191
#ifdef GFX_BL
192192
pinMode(GFX_BL, OUTPUT);

examples/AsciiTable/AsciiTable.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,20 @@ void setup(void)
6060
{
6161
Serial.println("gfx->begin() failed!");
6262
}
63-
gfx->fillScreen(BLACK);
63+
gfx->fillScreen(RGB565_BLACK);
6464

6565
#ifdef GFX_BL
6666
pinMode(GFX_BL, OUTPUT);
6767
digitalWrite(GFX_BL, HIGH);
6868
#endif
6969

70-
gfx->setTextColor(GREEN);
70+
gfx->setTextColor(RGB565_GREEN);
7171
for (int x = 0; x < 16; x++)
7272
{
7373
gfx->setCursor(10 + x * 8, 2);
7474
gfx->print(x, 16);
7575
}
76-
gfx->setTextColor(BLUE);
76+
gfx->setTextColor(RGB565_BLUE);
7777
for (int y = 0; y < 16; y++)
7878
{
7979
gfx->setCursor(2, 12 + y * 10);
@@ -85,7 +85,7 @@ void setup(void)
8585
{
8686
for (int x = 0; x < 16; x++)
8787
{
88-
gfx->drawChar(10 + x * 8, 12 + y * 10, c++, WHITE, BLACK);
88+
gfx->drawChar(10 + x * 8, 12 + y * 10, c++, RGB565_WHITE, RGB565_BLACK);
8989
}
9090
}
9191

examples/Clock/Clock.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */, false
4343
* End of Arduino_GFX setting
4444
******************************************************************************/
4545

46-
#define BACKGROUND BLACK
47-
#define MARK_COLOR WHITE
48-
#define SUBMARK_COLOR DARKGREY // LIGHTGREY
49-
#define HOUR_COLOR WHITE
50-
#define MINUTE_COLOR BLUE // LIGHTGREY
51-
#define SECOND_COLOR RED
46+
#define BACKGROUND RGB565_BLACK
47+
#define MARK_COLOR RGB565_WHITE
48+
#define SUBMARK_COLOR RGB565_DARKGREY // RGB565_LIGHTGREY
49+
#define HOUR_COLOR RGB565_WHITE
50+
#define MINUTE_COLOR RGB565_BLUE // RGB565_LIGHTGREY
51+
#define SECOND_COLOR RGB565_RED
5252

5353
#define SIXTIETH 0.016666667
5454
#define TWELFTH 0.08333333

examples/HelloWorld/HelloWorld.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ void setup(void)
5454
{
5555
Serial.println("gfx->begin() failed!");
5656
}
57-
gfx->fillScreen(BLACK);
57+
gfx->fillScreen(RGB565_BLACK);
5858

5959
#ifdef GFX_BL
6060
pinMode(GFX_BL, OUTPUT);
6161
digitalWrite(GFX_BL, HIGH);
6262
#endif
6363

6464
gfx->setCursor(10, 10);
65-
gfx->setTextColor(RED);
65+
gfx->setTextColor(RGB565_RED);
6666
gfx->println("Hello World!");
6767

6868
delay(5000); // 5 seconds

examples/HelloWorldGfxfont/HelloWorldGfxfont.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void setup(void)
5959
{
6060
Serial.println("gfx->begin() failed!");
6161
}
62-
gfx->fillScreen(BLACK);
62+
gfx->fillScreen(RGB565_BLACK);
6363

6464
#ifdef GFX_BL
6565
pinMode(GFX_BL, OUTPUT);
@@ -68,7 +68,7 @@ void setup(void)
6868

6969
gfx->setCursor(10, 10);
7070
gfx->setFont(&FreeMono8pt7b);
71-
gfx->setTextColor(RED);
71+
gfx->setTextColor(RGB565_RED);
7272
gfx->println("Hello World!");
7373

7474
delay(5000); // 5 seconds

examples/ImgViewer/ImgViewerAnimatedGIF_GIFDEC/ImgViewerAnimatedGIF_GIFDEC.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void setup()
117117
{
118118
Serial.println("gfx->begin() failed!");
119119
}
120-
gfx->fillScreen(BLACK);
120+
gfx->fillScreen(RGB565_BLACK);
121121

122122
#ifdef GFX_BL
123123
pinMode(GFX_BL, OUTPUT);

examples/ImgViewer/ImgViewerAnimatedGIF_bitbank/ImgViewerAnimatedGIF_bitbank.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void setup()
281281
{
282282
Serial.println("gfx->begin() failed!");
283283
}
284-
gfx->fillScreen(BLACK);
284+
gfx->fillScreen(RGB565_BLACK);
285285

286286
#ifdef GFX_BL
287287
pinMode(GFX_BL, OUTPUT);

examples/ImgViewer/ImgViewerBmp/ImgViewerBmp.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void setup()
115115
{
116116
Serial.println("gfx->begin() failed!");
117117
}
118-
gfx->fillScreen(BLACK);
118+
gfx->fillScreen(RGB565_BLACK);
119119

120120
#ifdef GFX_BL
121121
pinMode(GFX_BL, OUTPUT);

examples/ImgViewer/ImgViewerJpeg_ESP32_JPEG/ImgViewerJpeg_ESP32_JPEG.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void setup()
153153
{
154154
Serial.println("gfx->begin() failed!");
155155
}
156-
gfx->fillScreen(BLACK);
156+
gfx->fillScreen(RGB565_BLACK);
157157

158158
#ifdef GFX_BL
159159
pinMode(GFX_BL, OUTPUT);

0 commit comments

Comments
 (0)