Inkplate 13SPECTRA MicroPython - Drawing Graphics
Inkplate 13SPECTRA allows you to draw different geometric shapes anywhere on its 1600 x 1200px canvas. The shapes can be filled or hollow.
Drawing shapes
Below is a example that demonstates how to draw basic shapes in different colors.
from inkplate13SPECTRA import Inkplate
import time
inkplate = Inkplate()
inkplate.begin()
inkplate.clearDisplay()
inkplate.display()
inkplate.drawPixel(800, 600, inkplate.BLACK);
inkplate.drawRect(60, 60, 1480, 1080, inkplate.BLACK);
inkplate.drawRect(80, 80, 1440, 1040, inkplate.BLUE);
inkplate.drawRoundRect(110, 110, 1380, 980, 40, inkplate.YELLOW);
inkplate.drawLine(60, 60, 1540, 1140, inkplate.BLACK);
inkplate.drawLine(1540, 60, 60, 1140, inkplate.BLACK);
inkplate.drawFastHLine(60, 600, 1480, inkplate.RED);
inkplate.drawFastVLine(800, 60, 1080, inkplate.GREEN);
inkplate.drawCircle(400, 300, 120, inkplate.BLUE);
inkplate.fillCircle(1200, 300, 120, inkplate.GREEN);
inkplate.drawCircle(1200, 300, 120, inkplate.BLACK);
inkplate.fillRoundRect(220, 760, 420, 300, 35, inkplate.YELLOW);
inkplate.drawRoundRect(220, 760, 420, 300, 35, inkplate.BLACK);
inkplate.fillRect(980, 760, 420, 300, inkplate.WHITE);
inkplate.drawRect(980, 760, 420, 300, inkplate.BLACK);
inkplate.drawTriangle(800, 140, 680, 360, 920, 360, inkplate.RED);
inkplate.fillTriangle(800, 520, 650, 720, 950, 720, inkplate.BLUE);
inkplate.drawTriangle(800, 520, 650, 720, 950, 720, inkplate.BLACK);
inkplate.drawFastHLine(200, 180, 1200, inkplate.YELLOW);
inkplate.drawFastHLine(200, 1020, 1200, inkplate.YELLOW);
inkplate.drawFastVLine(220, 200, 800, inkplate.BLUE);
inkplate.drawFastVLine(1380, 200, 800, inkplate.BLUE);
inkplate.fillCircle(100, 100, 18, inkplate.RED);
inkplate.fillCircle(1500, 100, 18, inkplate.GREEN);
inkplate.fillCircle(100, 1100, 18, inkplate.BLUE);
inkplate.fillCircle(1500, 1100, 18, inkplate.BLACK);
inkplate.drawRect(50, 50, 75, 75, inkplate.BLUE);
inkplate.drawCircle(200, 200, 30, inkplate.GREEN);
inkplate.fillCircle(300, 300, 30, inkplate.BLACK);
inkplate.drawFastHLine(20, 100, 50, inkplate.RED);
inkplate.drawFastVLine(100, 20, 50, inkplate.BLACK);
inkplate.drawLine(100, 100, 400, 400, inkplate.BLACK);
inkplate.drawRoundRect(100, 10, 100, 100, 10, inkplate.YELLOW);
inkplate.fillRoundRect(10, 100, 100, 100, 10, inkplate.BLACK);
inkplate.drawTriangle(300, 100, 400, 150, 400, 100, inkplate.BLACK);
inkplate.display()

inkplate.drawPixel()
Set a single pixel in the frame buffer.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x | X coordinate. |
Number | y | Y coordinate. |
Const | color | Color constant (BLACK or WHITE in BW mode). |
inkplate.drawRect()
Draw an unfilled rectangle outline.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x | Left X. |
Number | y | Top Y. |
Number | w | Width in pixels. |
Number | h | Height in pixels. |
Const | color | Outline color. |
inkplate.drawCircle()
Draw an unfilled circle.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x0 | Center X. |
Number | y0 | Center Y. |
Number | r | Radius in pixels. |
Const | color | Outline color. |
inkplate.fillCircle()
Draw a filled circle.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x0 | Center X. |
Number | y0 | Center Y. |
Number | r | Radius in pixels. |
Const | color | Fill color. |
inkplate.drawFastHLine()
Draw a horizontal line quickly.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x | Start X. |
Number | y | Y position. |
Number | w | Line width in pixels. |
Const | color | Line color. |
inkplate.drawFastVLine()
Draw a vertical line quickly.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x | X position. |
Number | y | Start Y. |
Number | h | Line height in pixels. |
Const | color | Line color. |
inkplate.drawLine()
Draw a line from one point to another.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x0 | Start X. |
Number | y0 | Start Y. |
Number | x1 | End X. |
Number | y1 | End Y. |
Const | color | Line color. |
inkplate.drawRoundRect()
Draw an unfilled rectangle with rounded corners.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x | Left X. |
Number | y | Top Y. |
Number | w | Width in pixels. |
Number | h | Height in pixels. |
Number | radius | Corner radius in pixels. |
Const | color | Outline color. |
inkplate.fillRoundRect()
Draw a filled rectangle with rounded corners.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x | Left X. |
Number | y | Top Y. |
Number | w | Width in pixels. |
Number | h | Height in pixels. |
Number | radius | Corner radius in pixels. |
Const | color | Fill color. |
inkplate.drawTriangle()
Draw a triangle outline using three vertices.
Function parameters:
| Type | Name | Description |
|---|---|---|
Number | x0 | Vertex A X. |
Number | y0 | Vertex A Y. |
Number | x1 | Vertex B X. |
Number | y1 | Vertex B Y. |
Number | x2 | Vertex C X. |
Number | y2 | Vertex C Y. |
Const | color | Outline color. |