TFT_eSPI provides a complete set of fill methods that paint the interior of shapes with a solid colour, a gradient, or an anti-aliased smooth finish. These complement the outline-only methods on the Drawing Shapes page. All coordinates use screen pixels withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Marcussacapuces91/doc-TFT_eSPI/llms.txt
Use this file to discover all available pages before exploring further.
(0, 0) at the top-left of the current rotation. Colours should be 16-bit RGB565 values or TFT_* colour constants unless the method signature specifies uint32_t, in which case a 24-bit value is also accepted.
fillScreen() — Clear / Fill Entire Screen
Fill colour. Use a
TFT_* constant (e.g. TFT_BLACK) or an RGB565 value.fillRect() — Filled Rectangle
(x, y).
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Rectangle width in pixels.
Rectangle height in pixels.
Fill colour.
fillRoundRect() — Filled Rounded Rectangle
X coordinate of the bounding box top-left corner.
Y coordinate of the bounding box top-left corner.
Width of the rectangle.
Height of the rectangle.
Corner arc radius in pixels.
Fill colour.
fillSmoothRoundRect() — Anti-Aliased Filled Rounded Rectangle
bg_color. If bg_color is omitted (0x00FFFFFF), the background colour is read from the display for each edge pixel.
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Rectangle width.
Rectangle height.
Corner arc radius.
Fill colour.
Background colour for edge anti-aliasing. Default
0x00FFFFFF causes the background to be read from the TFT display.fillCircle() — Filled Circle
X coordinate of the centre.
Y coordinate of the centre.
Radius in pixels.
Fill colour.
fillSmoothCircle() — Anti-Aliased Filled Circle
bg_color.
X coordinate of the centre.
Y coordinate of the centre.
Radius in pixels.
Fill colour.
Background colour for anti-aliasing. Default
0x00FFFFFF reads from the display.fillCircleHelper() — Quadrant Fill Helper
fillRoundRect(). Fills one or more quadrant sectors of a circle. The cornername bitmask selects which sides to fill, and delta extends the fill vertically to connect the straight sides of a rounded rectangle.
X coordinate of the circle centre.
Y coordinate of the circle centre.
Radius in pixels.
Bitmask selecting which side to fill (0x1 = right side, 0x2 = left side).
Vertical extension for connecting horizontal span to rounded rect body.
Fill colour.
fillCircleHelper() is a low-level support function. Prefer fillRoundRect() or fillCircle() for typical use.fillEllipse() — Filled Ellipse
X coordinate of the centre.
Y coordinate of the centre.
Horizontal radius (semi-axis along X).
Vertical radius (semi-axis along Y).
Fill colour.
fillTriangle() — Filled Triangle
X coordinate of vertex 1.
Y coordinate of vertex 1.
X coordinate of vertex 2.
Y coordinate of vertex 2.
X coordinate of vertex 3.
Y coordinate of vertex 3.
Fill colour.
fillRectVGradient() — Vertical Gradient Rectangle
color1 at the top to color2 at the bottom.
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Rectangle width.
Rectangle height.
Gradient start colour (top edge).
Gradient end colour (bottom edge).
fillRectHGradient() — Horizontal Gradient Rectangle
color1 at the left edge to color2 at the right edge.
X coordinate of the top-left corner.
Y coordinate of the top-left corner.
Rectangle width.
Rectangle height.
Gradient start colour (left edge).
Gradient end colour (right edge).