Clone
3
Home
Daniel Brunner edited this page 2021-09-06 00:35:07 +02:00

Welcome to the esp-gui-lib wiki!

Rich text

Use the rich text rendering facilities to render colorful text.

#include <richtextrenderer.h>

const int16_t width = espgui::renderRichText("Color &1red &2green &3blue", 50, 50);
Esc Seq Result
&1 Sets the color to #ff0000 TFT_RED
&2 Sets the color to #00ff00 TFT_GREEN
&3 Sets the color to #0000ff TFT_BLUE
&4 Sets the color to #ffff00 TFT_YELLOW
&5 Sets the color to #000000 TFT_BLACK
&6 Sets the color to #ffffff TFT_WHITE
&7 Sets the color to #888888 TFT_GREY
&0 Restores original color (previously set with tft.setTextColor()
&& Prints single & character without changing anything else
&s Changes to small font 2
&m Changes to medium font 4
&f Restores original font size