Image & Canvas
canvasCreate
$canvasCreate
Creates a blank canvas with the given dimensions and optional background color
Syntax
$canvasCreate[name;width;height;color?]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | check_circle Required | — | Identifier for the canvas (used by $attachImage) |
| width | integer | check_circle Required | — | Canvas width in pixels (clamped to 1–4096) |
| height | integer | check_circle Required | — | Canvas height in pixels (clamped to 1–4096) |
| color | color | Optional |
white
|
Background fill color
red
green
blue
white
black
transparent
yellow
cyan
magenta
orange
purple
pink
gray
grey
lime
navy
teal
aqua
maroon
silver
gold
#RRGGBB
#RRGGBBAA
|
Return Value
canvas
Initialises a new deferred image block. The canvas is not rendered until the block is flushed (by encountering a non-canvas function or $attachImage).
Canvas dimensions are clamped to a maximum of 4096 pixels in either direction. The canvas operates in a deferred rendering model: drawing operations are queued and only executed when the block is flushed — either when a non-canvas function is encountered or when $attachImage is called. Always pair $canvasCreate with a matching $attachImage to produce visible output.
Examples
Basic white canvas
$canvasCreate[myImage;400;300]
$canvasDrawText[Hello!;20;140;24;black]
$attachImage[myImage]
Transparent canvas
$canvasCreate[overlay;200;200;transparent]
$canvasDrawCircle[100;100;80;E53935;true]
$attachImage[overlay]
Dark themed canvas
$canvasCreate[card;600;400;#1a1a2e]
$canvasDrawText[Welcome;300;30;28;white;center;600]
$attachImage[card]