Skip to main content

Inkplate 13SPECTRA – Drawing colorful graphics

Inkplate 13SPECTRA allows you to draw colorful grahpics on a 1600 x 1200px canvas.

ℹ️
Adafruit GFX is the graphics library included in the Inkplate library for drawing graphics. For more details, refer to the official repository:

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:

ℹ️
There are total of 6 colors to choose from: 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
}
Example output displayed on e-paper display
Example output displayed on e-paper display

elow are the detailed references for these functions:

inkplate.fillRect()

Draws a filled rectangle on the display.

Returns value: none

Function parameters:

TypeNameDescription
intxThe x-coordinate of the top-left corner.
intyThe y-coordinate of the top-left corner.
intwidthThe width of the rectangle.
intheightThe height of the rectangle.
uint8_tcolorThe 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:

TypeNameDescription
intxThe x-coordinate of the top-left corner.
intyThe y-coordinate of the top-left corner.
intwidthThe width of the rectangle.
intheightThe height of the rectangle.
uint16_tcolorThe outline color.

inkplate.fillRect()

Draws a filled rectangle on the display.

Returns value: none

Function parameters:

TypeNameDescription
intxThe x-coordinate of the top-left corner.
intyThe y-coordinate of the top-left corner.
intwidthThe width of the rectangle.
intheightThe height of the rectangle.
uint16_tcolorThe fill color.

inkplate.drawRoundRect()

Draws the outline of a rectangle with rounded corners.

Returns value: none

Function parameters:

TypeNameDescription
intxThe x-coordinate of the top-left corner.
intyThe y-coordinate of the top-left corner.
intwidthThe width of the rectangle.
intheightThe height of the rectangle.
intradiusThe radius of the rounded corners.
uint16_tcolorThe outline color.

inkplate.fillRoundRect()

Draws a filled rectangle with rounded corners.

Returns value: none

Function parameters:

TypeNameDescription
intxThe x-coordinate of the top-left corner.
intyThe y-coordinate of the top-left corner.
intwidthThe width of the rectangle.
intheightThe height of the rectangle.
intradiusThe radius of the rounded corners.
uint16_tcolorThe fill color.

inkplate.drawTriangle()

Draws the outline of a triangle using three points.

Returns value: none

Function parameters:

TypeNameDescription
intx0The x-coordinate of the first vertex.
inty0The y-coordinate of the first vertex.
intx1The x-coordinate of the second vertex.
inty1The y-coordinate of the second vertex.
intx2The x-coordinate of the third vertex.
inty2The y-coordinate of the third vertex.
uint16_tcolorThe outline color.

inkplate.fillTriangle()

Draws a filled triangle using three points.

Returns value: none

Function parameters:

TypeNameDescription
intx0The x-coordinate of the first vertex.
inty0The y-coordinate of the first vertex.
intx1The x-coordinate of the second vertex.
inty1The y-coordinate of the second vertex.
intx2The x-coordinate of the third vertex.
inty2The y-coordinate of the third vertex.
uint16_tcolorThe fill color.

inkplate.drawLine()

Draws a straight line between two points.

Returns value: none

Function parameters:

TypeNameDescription
intx0The x-coordinate of the starting point.
inty0The y-coordinate of the starting point.
intx1The x-coordinate of the ending point.
inty1The y-coordinate of the ending point.
uint16_tcolorThe line color.

inkplate.drawPixel()

Draws a single pixel at the specified coordinates.

Returns value: none

Function parameters:

TypeNameDescription
intxThe x-coordinate of the pixel.
intyThe y-coordinate of the pixel.
uint16_tcolorThe pixel color.