About ColorCode

M5GFX automatically detects RGB888, RGB565, RGB332. by the color code type used.

Type Color
uint8_t RGB332
uint16_t RGB565
uint32_t RGB888

ColorCode list

Color Hex R G B
TFT_BLACK 0x0000 0 0 0
TFT_NAVY 0x000F 0 0 128
TFT_DARKGREEN 0x03E0 0 128 0
TFT_DARKCYAN 0x03EF 0 128 128
TFT_MAROON 0x7800 128 0 0
TFT_PURPLE 0x780F 128 0 128
TFT_OLIVE 0x7BE0 128 128 0
TFT_LIGHTGREY 0xD69A 211 211 211
TFT_LIGHTGRAY 0xD69A 211 211 211
TFT_DARKGREY 0x7BEF 128 128 128
TFT_DARKGRAY 0x7BEF 128 128 128
TFT_BLUE 0x001F 0 0 255
TFT_GREEN 0x07E0 0 255 0
TFT_CYAN 0x07FF 0 255 255
TFT_RED 0xF800 255 0 0
TFT_MAGENTA 0xF81F 255 0 255
TFT_YELLOW 0xFFE0 255 255 0
TFT_WHITE 0xFFFF 255 255 255
TFT_ORANGE 0xFDA0 255 180 0
TFT_GREENYELLOW 0xB7E0 180 255 0
TFT_PINK 0xFE19 255 192 203
TFT_BROWN 0x9A60 150 75 0
TFT_GOLD 0xFEA0 255 215 0
TFT_SILVER 0xC618 192 192 192
TFT_SKYBLUE 0x867D 135 206 235
TFT_VIOLET 0x915C 180 46 226
TFT_TRANSPARENT 0x0120

About TextDatum

Specifies the base coordinates for displaying text.

top_lefttop_centertop_right
middle_leftmiddle_centermiddle_right
bottom_leftbottom_centerbottom_right

*1. center can also centre

About ImageDatum

Specifies the base coordinates for displaying image.

datum_t::top_leftdatum_t::top_centerdatum_t::top_right
datum_t::middle_leftdatum_t::middle_centerdatum_t::middle_right
datum_t::bottom_leftdatum_t::bottom_centerdatum_t::bottom_right

*1. center can also centre

Font List

Latin Font

font name remarks
&fonts::Font0
&fonts::Font2
&fonts::Font4
&fonts::Font6
&fonts::Font7
&fonts::Font8
&fonts::Font8x8C64
&fonts::AsciiFont8x16
&fonts::AsciiFont24x48
&fonts::TomThumb
&fonts::FreeMono9pt7b
&fonts::FreeMono12pt7b
&fonts::FreeMono18pt7b
&fonts::FreeMono24pt7b
&fonts::FreeMonoBold9pt7b
&fonts::FreeMonoBold12pt7b
&fonts::FreeMonoBold18pt7b
&fonts::FreeMonoBold24pt7b
&fonts::FreeMonoOblique9pt7b
&fonts::FreeMonoOblique12pt7b
&fonts::FreeMonoOblique18pt7b
&fonts::FreeMonoOblique24pt7b
&fonts::FreeMonoBoldOblique9pt7b
&fonts::FreeMonoBoldOblique12pt7b
&fonts::FreeMonoBoldOblique18pt7b
&fonts::FreeMonoBoldOblique24pt7b
&fonts::FreeSans9pt7b
&fonts::FreeSans12pt7b
&fonts::FreeSans18pt7b
&fonts::FreeSans24pt7b
&fonts::FreeSansBold9pt7b
&fonts::FreeSansBold12pt7b
&fonts::FreeSansBold18pt7b
&fonts::FreeSansBold24pt7b
&fonts::FreeSansOblique9pt7b
&fonts::FreeSansOblique12pt7b
&fonts::FreeSansOblique18pt7b
&fonts::FreeSansOblique24pt7b
&fonts::FreeSansBoldOblique9pt7b
&fonts::FreeSansBoldOblique12pt7b
&fonts::FreeSansBoldOblique18pt7b
&fonts::FreeSansBoldOblique24pt7b
&fonts::FreeSerif9pt7b
&fonts::FreeSerif12pt7b
&fonts::FreeSerif18pt7b
&fonts::FreeSerif24pt7b
&fonts::FreeSerifItalic9pt7b
&fonts::FreeSerifItalic12pt7b
&fonts::FreeSerifItalic18pt7b
&fonts::FreeSerifItalic24pt7b
&fonts::FreeSerifBold9pt7b
&fonts::FreeSerifBold12pt7b
&fonts::FreeSerifBold18pt7b
&fonts::FreeSerifBold24pt7b
&fonts::FreeSerifBoldItalic9pt7b
&fonts::FreeSerifBoldItalic12pt7b
&fonts::FreeSerifBoldItalic18pt7b
&fonts::FreeSerifBoldItalic24pt7b
&fonts::Orbitron_Light_24
&fonts::Orbitron_Light_32
&fonts::Roboto_Thin_24
&fonts::Satisfy_24
&fonts::Yellowtail_32
&fonts::DejaVu12
&fonts::DejaVu18
&fonts::DejaVu24
&fonts::DejaVu40
&fonts::DejaVu56
&fonts::DejaVu72
&fonts::DejaVu9

Unicode Font

font name Language Code
&font::lgfxJapanMincho_8 JA
&font::lgfxJapanMincho_12 JA
&font::lgfxJapanMincho_16 JA
&font::lgfxJapanMincho_20 JA
&font::lgfxJapanMincho_24 JA
&font::lgfxJapanMincho_28 JA
&font::lgfxJapanMincho_32 JA
&font::lgfxJapanMincho_36 JA
&font::lgfxJapanMincho_40 JA
&font::lgfxJapanMinchoP_8 JA
&font::lgfxJapanMinchoP_12 JA
&font::lgfxJapanMinchoP_16 JA
&font::lgfxJapanMinchoP_20 JA
&font::lgfxJapanMinchoP_24 JA
&font::lgfxJapanMinchoP_28 JA
&font::lgfxJapanMinchoP_32 JA
&font::lgfxJapanMinchoP_36 JA
&font::lgfxJapanMinchoP_40 JA
&font::lgfxJapanGothic_8 JA
&font::lgfxJapanGothic_12 JA
&font::lgfxJapanGothic_16 JA
&font::lgfxJapanGothic_20 JA
&font::lgfxJapanGothic_24 JA
&font::lgfxJapanGothic_28 JA
&font::lgfxJapanGothic_32 JA
&font::lgfxJapanGothic_36 JA
&font::lgfxJapanGothic_40 JA
&font::lgfxJapanGothicP_8 JA
&font::lgfxJapanGothicP_12 JA
&font::lgfxJapanGothicP_16 JA
&font::lgfxJapanGothicP_20 JA
&font::lgfxJapanGothicP_24 JA
&font::lgfxJapanGothicP_28 JA
&font::lgfxJapanGothicP_32 JA
&font::lgfxJapanGothicP_36 JA
&font::lgfxJapanGothicP_40 JA
&font::efontCN_10 zh-CN
&font::efontCN_10_b zh-CN
&font::efontCN_10_bi zh-CN
&font::efontCN_10_i zh-CN
&font::efontCN_12 zh-CN
&font::efontCN_12_b zh-CN
&font::efontCN_12_bi zh-CN
&font::efontCN_12_i zh-CN
&font::efontCN_14 zh-CN
&font::efontCN_14_b zh-CN
&font::efontCN_14_bi zh-CN
&font::efontCN_14_i zh-CN
&font::efontCN_16 zh-CN
&font::efontCN_16_b zh-CN
&font::efontCN_16_bi zh-CN
&font::efontCN_16_i zh-CN
&font::efontCN_24 zh-CN
&font::efontCN_24_b zh-CN
&font::efontCN_24_bi zh-CN
&font::efontCN_24_i zh-CN
&font::efontJA_10 JA
&font::efontJA_10_b JA
&font::efontJA_10_bi JA
&font::efontJA_10_i JA
&font::efontJA_12 JA
&font::efontJA_12_b JA
&font::efontJA_12_bi JA
&font::efontJA_12_i JA
&font::efontJA_14 JA
&font::efontJA_14_b JA
&font::efontJA_14_bi JA
&font::efontJA_14_i JA
&font::efontJA_16 JA
&font::efontJA_16_b JA
&font::efontJA_16_bi JA
&font::efontJA_16_i JA
&font::efontJA_24 JA
&font::efontJA_24_b JA
&font::efontJA_24_bi JA
&font::efontJA_24_i JA
&font::efontKR_10 KO
&font::efontKR_10_b KO
&font::efontKR_10_bi KO
&font::efontKR_10_i KO
&font::efontKR_12 KO
&font::efontKR_12_b KO
&font::efontKR_12_bi KO
&font::efontKR_12_i KO
&font::efontKR_14 KO
&font::efontKR_14_b KO
&font::efontKR_14_bi KO
&font::efontKR_14_i KO
&font::efontKR_16 KO
&font::efontKR_16_b KO
&font::efontKR_16_bi KO
&font::efontKR_16_i KO
&font::efontKR_24 KO
&font::efontKR_24_b KO
&font::efontKR_24_bi KO
&font::efontKR_24_i KO
&font::efontTW_10 zh-TW
&font::efontTW_10_b zh-TW
&font::efontTW_10_bi zh-TW
&font::efontTW_10_i zh-TW
&font::efontTW_12 zh-TW
&font::efontTW_12_b zh-TW
&font::efontTW_12_bi zh-TW
&font::efontTW_12_i zh-TW
&font::efontTW_14 zh-TW
&font::efontTW_14_b zh-TW
&font::efontTW_14_bi zh-TW
&font::efontTW_14_i zh-TW
&font::efontTW_16 zh-TW
&font::efontTW_16_b zh-TW
&font::efontTW_16_bi zh-TW
&font::efontTW_16_i zh-TW
&font::efontTW_24 zh-TW
&font::efontTW_24_b zh-TW
&font::efontTW_24_bi zh-TW
&font::efontTW_24_i zh-TW

About Color Depth

Value bit Number of Color
1 1 bit 2
4 4 bit 16
8 8 bit 256
16 16 bit 65,536
24 24 bit 16,777,216

enum epd_mode_t

Type Description
epd_quality Beautiful rendering but slow speed mode
epd_text
epd_fast
epd_fastest Faster rendering speed, but worse quality.

struct TextStyle

Parameter Type Description
fore_rgb888 uint32_t Text Color
back_rgb888 uint32_t Background Color
size_x float Text Size X
size_y float Text Size Y
datum textdatum_t (*1) Text Datum
padding_x int32_t Padding X
utf8 bool UTF8 encode
cp437 bool cp437 encode

*1. About textdatum

struct FontMetrics

Parameter Type Description
width int16_t Font width
x_advance int16_t X advance
x_offset int16_t X offset
height int16_t Font height
y_advance int16_t Y advance
y_offset int16_t Y offset

difference between draw/push and write functions

Unlike the draw/push functions, the write functions are not defined by startWrite() , endWrite() . draw/push functions automatically execute startWrite() and endWrite() internally, which makes processing slightly slower when multiple drawings are performed in succession. In such a case, speed can be increased by writing all draw/push functions together between startWrite and endWrite.

draw/push and write functions table

write(read) draw or push
writePixel drawPixel
writePixels pushPixels
writePixelsDMA pushPixelsDMA
writeFastHLine drawFastHLine
writeFastVLine drawFastVLine
writeFillRect fillRect
writeColor pushBlock
writeCommand -
writeCommand16 -
writeData -
writeData16 -
writeData32 -
readData8 -
readData16 -
readData32 -
On This Page