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_left | top_center | top_right |
middle_left | middle_center | middle_right |
bottom_left | bottom_center | bottom_right |
*1. center can also centre
About ImageDatum
Specifies the base coordinates for displaying image.
datum_t::top_left | datum_t::top_center | datum_t::top_right |
datum_t::middle_left | datum_t::middle_center | datum_t::middle_right |
datum_t::bottom_left | datum_t::bottom_center | datum_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 |
&fonts::lgfxJapanMincho_8 | JA |
&fonts::lgfxJapanMincho_12 | JA |
&fonts::lgfxJapanMincho_16 | JA |
&fonts::lgfxJapanMincho_20 | JA |
&fonts::lgfxJapanMincho_24 | JA |
&fonts::lgfxJapanMincho_28 | JA |
&fonts::lgfxJapanMincho_32 | JA |
&fonts::lgfxJapanMincho_36 | JA |
&fonts::lgfxJapanMincho_40 | JA |
&fonts::lgfxJapanMinchoP_8 | JA |
&fonts::lgfxJapanMinchoP_12 | JA |
&fonts::lgfxJapanMinchoP_16 | JA |
&fonts::lgfxJapanMinchoP_20 | JA |
&fonts::lgfxJapanMinchoP_24 | JA |
&fonts::lgfxJapanMinchoP_28 | JA |
&fonts::lgfxJapanMinchoP_32 | JA |
&fonts::lgfxJapanMinchoP_36 | JA |
&fonts::lgfxJapanMinchoP_40 | JA |
&fonts::lgfxJapanGothic_8 | JA |
&fonts::lgfxJapanGothic_12 | JA |
&fonts::lgfxJapanGothic_16 | JA |
&fonts::lgfxJapanGothic_20 | JA |
&fonts::lgfxJapanGothic_24 | JA |
&fonts::lgfxJapanGothic_28 | JA |
&fonts::lgfxJapanGothic_32 | JA |
&fonts::lgfxJapanGothic_36 | JA |
&fonts::lgfxJapanGothic_40 | JA |
&fonts::lgfxJapanGothicP_8 | JA |
&fonts::lgfxJapanGothicP_12 | JA |
&fonts::lgfxJapanGothicP_16 | JA |
&fonts::lgfxJapanGothicP_20 | JA |
&fonts::lgfxJapanGothicP_24 | JA |
&fonts::lgfxJapanGothicP_28 | JA |
&fonts::lgfxJapanGothicP_32 | JA |
&fonts::lgfxJapanGothicP_36 | JA |
&fonts::lgfxJapanGothicP_40 | JA |
&fonts::efontCN_10 | zh-CN |
&fonts::efontCN_10_b | zh-CN |
&fonts::efontCN_10_bi | zh-CN |
&fonts::efontCN_10_i | zh-CN |
&fonts::efontCN_12 | zh-CN |
&fonts::efontCN_12_b | zh-CN |
&fonts::efontCN_12_bi | zh-CN |
&fonts::efontCN_12_i | zh-CN |
&fonts::efontCN_14 | zh-CN |
&fonts::efontCN_14_b | zh-CN |
&fonts::efontCN_14_bi | zh-CN |
&fonts::efontCN_14_i | zh-CN |
&fonts::efontCN_16 | zh-CN |
&fonts::efontCN_16_b | zh-CN |
&fonts::efontCN_16_bi | zh-CN |
&fonts::efontCN_16_i | zh-CN |
&fonts::efontCN_24 | zh-CN |
&fonts::efontCN_24_b | zh-CN |
&fonts::efontCN_24_bi | zh-CN |
&fonts::efontCN_24_i | zh-CN |
&fonts::efontJA_10 | JA |
&fonts::efontJA_10_b | JA |
&fonts::efontJA_10_bi | JA |
&fonts::efontJA_10_i | JA |
&fonts::efontJA_12 | JA |
&fonts::efontJA_12_b | JA |
&fonts::efontJA_12_bi | JA |
&fonts::efontJA_12_i | JA |
&fonts::efontJA_14 | JA |
&fonts::efontJA_14_b | JA |
&fonts::efontJA_14_bi | JA |
&fonts::efontJA_14_i | JA |
&fonts::efontJA_16 | JA |
&fonts::efontJA_16_b | JA |
&fonts::efontJA_16_bi | JA |
&fonts::efontJA_16_i | JA |
&fonts::efontJA_24 | JA |
&fonts::efontJA_24_b | JA |
&fonts::efontJA_24_bi | JA |
&fonts::efontJA_24_i | JA |
&fonts::efontKR_10 | KO |
&fonts::efontKR_10_b | KO |
&fonts::efontKR_10_bi | KO |
&fonts::efontKR_10_i | KO |
&fonts::efontKR_12 | KO |
&fonts::efontKR_12_b | KO |
&fonts::efontKR_12_bi | KO |
&fonts::efontKR_12_i | KO |
&fonts::efontKR_14 | KO |
&fonts::efontKR_14_b | KO |
&fonts::efontKR_14_bi | KO |
&fonts::efontKR_14_i | KO |
&fonts::efontKR_16 | KO |
&fonts::efontKR_16_b | KO |
&fonts::efontKR_16_bi | KO |
&fonts::efontKR_16_i | KO |
&fonts::efontKR_24 | KO |
&fonts::efontKR_24_b | KO |
&fonts::efontKR_24_bi | KO |
&fonts::efontKR_24_i | KO |
&fonts::efontTW_10 | zh-TW |
&fonts::efontTW_10_b | zh-TW |
&fonts::efontTW_10_bi | zh-TW |
&fonts::efontTW_10_i | zh-TW |
&fonts::efontTW_12 | zh-TW |
&fonts::efontTW_12_b | zh-TW |
&fonts::efontTW_12_bi | zh-TW |
&fonts::efontTW_12_i | zh-TW |
&fonts::efontTW_14 | zh-TW |
&fonts::efontTW_14_b | zh-TW |
&fonts::efontTW_14_bi | zh-TW |
&fonts::efontTW_14_i | zh-TW |
&fonts::efontTW_16 | zh-TW |
&fonts::efontTW_16_b | zh-TW |
&fonts::efontTW_16_bi | zh-TW |
&fonts::efontTW_16_i | zh-TW |
&fonts::efontTW_24 | zh-TW |
&fonts::efontTW_24_b | zh-TW |
&fonts::efontTW_24_bi | zh-TW |
&fonts::efontTW_24_i | zh-TW |
About Color Depth
Value | bit | Number of Color |
1 | 1 bit | 2 |
2 | 2 bit | 4 |
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 | - |