M5GFX automatically detects RGB888, RGB565, and RGB332 according to the color data type in use.
| Type | Color |
|---|---|
| uint8_t | RGB332 |
| uint16_t | RGB565 |
| uint32_t | RGB888 |
| Color | Hex Value | Red (R) | Green (G) | Blue (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 |
| Value | Bits | Number of Colors |
|---|---|---|
| 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 |
| Type | Description |
|---|---|
| epd_quality | Fine rendering, slower speed |
| epd_text | ↑ |
| epd_fast | ↓ |
| epd_fastest | Faster rendering, but lower quality |
Reference point for displayed text
| Left Aligned | Center Aligned | Right Aligned |
|---|---|---|
| top_left | top_center | top_right |
| middle_left | middle_center | middle_right |
| bottom_left | bottom_center | bottom_right |
| baseline_left | baseline_center | baseline_right |
| Parameter | Type | Description |
|---|---|---|
| fore_rgb888 | uint32_t | Font color |
| back_rgb888 | uint32_t | Background color |
| size_x | float | Text X scale |
| size_y | float | Text Y scale |
| datum | textdatum_t | Text anchor |
| padding_x | int32_t | Padding X |
| utf8 | bool | UTF8 encoding |
| cp437 | bool | cp437 encoding |
| Parameter | Type | Description |
|---|---|---|
| x | int16_t | X coordinate |
| y | int16_t | Y coordinate |
| size | uint16_t | Point size |
| id | uint8_t | Point ID |
Unlike draw/push functions, write functions are not wrapped by startWrite and endWrite.
draw/push functions call startWrite and endWrite internally, which makes them slightly slower when executing many drawing operations consecutively. In such cases, execute all draw/push functions between a single startWrite and endWrite to improve speed.
| write(read) | draw or push (etc) |
|---|---|
| writePixel | drawPixel |
| writePixels | pushPixels |
| writePixelsDMA | pushPixelsDMA |
| writeFastHLine | drawFastHLine |
| writeFastVLine | drawFastVLine |
| writeFillRect | fillRect |
| writeColor | |
| pushBlock |
pushBlock was not named writeBlock for library version compatibility.| 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 |
| 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 | KR |
| &fonts::efontKR_10_b | KR |
| &fonts::efontKR_10_bi | KR |
| &fonts::efontKR_10_i | KR |
| &fonts::efontKR_12 | KR |
| &fonts::efontKR_12_b | KR |
| &fonts::efontKR_12_bi | KR |
| &fonts::efontKR_12_i | KR |
| &fonts::efontKR_14 | KR |
| &fonts::efontKR_14_b | KR |
| &fonts::efontKR_14_bi | KR |
| &fonts::efontKR_14_i | KR |
| &fonts::efontKR_16 | KR |
| &fonts::efontKR_16_b | KR |
| &fonts::efontKR_16_bi | KR |
| &fonts::efontKR_16_i | KR |
| &fonts::efontKR_24 | KR |
| &fonts::efontKR_24_b | KR |
| &fonts::efontKR_24_bi | KR |
| &fonts::efontKR_24_i | KR |
| &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 |