Inkplate 13SPECTRA – Drawing colorful graphics
Inkplate 13SPECTRA allows you to draw colorful grahpics on a 1600 x 1200px canvas.
Adafruit GFX Library
The core graphics library for Inkplate library, created by Adafruit.
Color spectrum
Below is an example demonstrating drawing in all available colors on the Inkplate 13SPECTRA:
INKPLATE_BLACK, INKPLATE_WHITE, INKPLATE_YELLOW, INKPLATE_RED, INKPLATE_BLUE, INKPLATE_GREEN
#include "Inkplate.h"
// Declare Inkplate object
Inkplate display;
void setup(){
// Initialize Inkplate
display.begin();
display.clearDisplay();
// Draw a full screen of all colors
display.fillRect(0, 0, 1600 / 6 + 2, 1200, INKPLATE_BLACK);
display.fillRect(1 * 1600 / 6, 0, 1600 / 6 + 2, 1200, INKPLATE_WHITE);
display.fillRect(2 * 1600 / 6, 0, 1600 / 6 + 2, 1200, INKPLATE_YELLOW);
display.fillRect(3 * 1600 / 6, 0, 1600 / 6 + 2, 1200, INKPLATE_RED);
display.fillRect(4 * 1600 / 6, 0, 1600 / 6 + 2, 1200, INKPLATE_BLUE-1);
display.fillRect(5 * 1600 / 6, 0, 1600 / 6 + 2, 1200, INKPLATE_GREEN-1);
// Show the Image on the screen
display.display();
}
void loop(){
// Loop forever
}

elow are the detailed references for these functions:
inkplate.fillRect()
Draws a filled rectangle on the display.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the top-left corner. |
int | y | The y-coordinate of the top-left corner. |
int | width | The width of the rectangle. |
int | height | The height of the rectangle. |
uint8_t | color | The fill color. |
Drawing graphics
Below is an example demonstrating functions for drawing graphics on the Inkplate 13SPECTRA:
void setup(){
display.clear();
display.clearDisplay();
display.fillScreen(INKPLATE_WHITE);
// Rectangles
display.drawRect(40, 40, 520, 240, INKPLATE_BLACK);
display.fillRect(60, 60, 200, 80, INKPLATE_YELLOW);
display.drawRect(60, 60, 200, 80, INKPLATE_BLACK);
display.fillRoundRect(290, 60, 240, 80, 16, INKPLATE_RED);
display.drawRoundRect(290, 60, 240, 80, 16, INKPLATE_BLACK);
// Circles
display.drawCircle(160, 220, 60, INKPLATE_BLUE);
display.fillCircle(380, 220, 60, INKPLATE_GREEN);
display.drawCircle(380, 220, 60, INKPLATE_BLACK);
// Triangle
display.fillTriangle(520, 320, 640, 160, 760, 320, INKPLATE_YELLOW);
display.drawTriangle(520, 320, 640, 160, 760, 320, INKPLATE_BLACK);
// Lines
display.drawLine(40, 360, 760, 520, INKPLATE_BLACK);
display.drawLine(40, 390, 760, 550, INKPLATE_RED);
display.drawLine(40, 420, 760, 580, INKPLATE_YELLOW);
display.drawLine(40, 450, 760, 610, INKPLATE_BLUE);
display.drawLine(40, 480, 760, 640, INKPLATE_GREEN);
for (int x = 40; x < 760; x += 8) {
uint16_t color = INKPLATE_BLACK;
if (x % 48 == 0) {
color = INKPLATE_RED;
} else if (x % 40 == 0) {
color = INKPLATE_YELLOW;
} else if (x % 32 == 0) {
color = INKPLATE_GREEN;
} else if (x % 24 == 0) {
color = INKPLATE_BLUE;
}
// Simple text
display.setTextSize(3);
display.setTextColor(INKPLATE_BLACK);
display.setCursor(40, 760);
display.print("Inkplate 13 Spectra");
display.setTextSize(2);
display.setCursor(40, 800);
display.print("Adafruit_GFX shapes & colors");
// Update e-paper
display.display();
}
}
Below are the detailed references to these functions:
inkplate.drawRect()
Draws the outline of a rectangle on the display.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the top-left corner. |
int | y | The y-coordinate of the top-left corner. |
int | width | The width of the rectangle. |
int | height | The height of the rectangle. |
uint16_t | color | The outline color. |
inkplate.fillRect()
Draws a filled rectangle on the display.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the top-left corner. |
int | y | The y-coordinate of the top-left corner. |
int | width | The width of the rectangle. |
int | height | The height of the rectangle. |
uint16_t | color | The fill color. |
inkplate.drawRoundRect()
Draws the outline of a rectangle with rounded corners.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the top-left corner. |
int | y | The y-coordinate of the top-left corner. |
int | width | The width of the rectangle. |
int | height | The height of the rectangle. |
int | radius | The radius of the rounded corners. |
uint16_t | color | The outline color. |
inkplate.fillRoundRect()
Draws a filled rectangle with rounded corners.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the top-left corner. |
int | y | The y-coordinate of the top-left corner. |
int | width | The width of the rectangle. |
int | height | The height of the rectangle. |
int | radius | The radius of the rounded corners. |
uint16_t | color | The fill color. |
inkplate.drawTriangle()
Draws the outline of a triangle using three points.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x0 | The x-coordinate of the first vertex. |
int | y0 | The y-coordinate of the first vertex. |
int | x1 | The x-coordinate of the second vertex. |
int | y1 | The y-coordinate of the second vertex. |
int | x2 | The x-coordinate of the third vertex. |
int | y2 | The y-coordinate of the third vertex. |
uint16_t | color | The outline color. |
inkplate.fillTriangle()
Draws a filled triangle using three points.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x0 | The x-coordinate of the first vertex. |
int | y0 | The y-coordinate of the first vertex. |
int | x1 | The x-coordinate of the second vertex. |
int | y1 | The y-coordinate of the second vertex. |
int | x2 | The x-coordinate of the third vertex. |
int | y2 | The y-coordinate of the third vertex. |
uint16_t | color | The fill color. |
inkplate.drawLine()
Draws a straight line between two points.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x0 | The x-coordinate of the starting point. |
int | y0 | The y-coordinate of the starting point. |
int | x1 | The x-coordinate of the ending point. |
int | y1 | The y-coordinate of the ending point. |
uint16_t | color | The line color. |
inkplate.drawPixel()
Draws a single pixel at the specified coordinates.
Returns value: none
Function parameters:
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the pixel. |
int | y | The y-coordinate of the pixel. |
uint16_t | color | The pixel color. |