From 706ab0e740b13e2bfc2656c765866a7a48c00506 Mon Sep 17 00:00:00 2001 From: bivanbi Date: Tue, 11 Feb 2025 20:34:42 +0100 Subject: [PATCH] Add Inkplate2 Peripheral Mode command setTextColor Fixes #266 Without setting text color first, displayed text will be invisible. Add setTextColor to Peripheral Mode to be able to set text color. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/SolderedElectronics/Inkplate-Arduino-library/issues/266?shareId=XXXX-XXXX-XXXX-XXXX). --- .../Inkplate2_Peripheral_Mode.ino | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/Inkplate2/Diagnostics/Inkplate2_Peripheral_Mode/Inkplate2_Peripheral_Mode.ino b/examples/Inkplate2/Diagnostics/Inkplate2_Peripheral_Mode/Inkplate2_Peripheral_Mode.ino index a5317eb9..8d634f69 100644 --- a/examples/Inkplate2/Diagnostics/Inkplate2_Peripheral_Mode/Inkplate2_Peripheral_Mode.ino +++ b/examples/Inkplate2/Diagnostics/Inkplate2_Peripheral_Mode/Inkplate2_Peripheral_Mode.ino @@ -71,7 +71,7 @@ void loop() { if ((e - s) > 0) { - int x, x1, x2, y, y1, y2, x3, y3, l, c, w, h, r, n, rx, ry, xc, yc; + int x, x1, x2, y, y1, y2, x3, y3, l, c, w, h, r, n, rx, ry, xc, yc, fgColor, bgColor; char b; char temp[150]; switch (*(s + 1)) @@ -196,6 +196,11 @@ void loop() display.setRotation(c); break; + case 'H': + // Set text and background color + sscanf(s + 3, "%d,%d", &fgColor, &bgColor); + display.setTextColor(fgColor, bgColor); + break; case 'K': // Clear the display (frame buffer only)