From 56faf93543c82e9182c16bf781facfeffddc944f Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Thu, 9 Jun 2022 11:15:02 +0200 Subject: [PATCH] Added richtext colors for easier use --- src/richtexthelper.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/richtexthelper.h diff --git a/src/richtexthelper.h b/src/richtexthelper.h new file mode 100644 index 0000000..31a2772 --- /dev/null +++ b/src/richtexthelper.h @@ -0,0 +1,20 @@ +#pragma once + +namespace espgui { +namespace colors { +constexpr char RED[] = "&1"; // #ff0000 (TFT_RED) +constexpr char GREEN[] = "&2"; // #00ff00 (TFT_GREEN) +constexpr char BLUE[] = "&3"; // #0000ff (TFT_BLUE) +constexpr char YELLOW[] = "&4"; // #ffff00 (TFT_YELLOW) +constexpr char BLACK[] = "&5"; // #000000 (TFT_BLACK) +constexpr char WHITE[] = "&6"; // #ffffff (TFT_WHITE) +constexpr char GREY[] = "&7"; // #888888 (TFT_GREY) +constexpr char RESET[] = "&0"; // reset to previous color set by tft.setTextColor() +} // namespace colors + +namespace fonts { +constexpr char SMALL[] = "&s"; // tft.setTextFont(2) +constexpr char MEDIUM[] = "&m"; // tft.setTextFont(4) +constexpr char RESTORE[] = "&f"; // restore original font +} // namespace fonts +} // namespace espgui