term.gfx.canvas — Lilush API

←index

← term.gfx

Overview

Pixel canvas — an ergonomic Lua wrapper over the C term.gfx_core surface.

The surface holds the raw RGBA bytes and does the per-pixel/blit/serialize work in C; this layer adds the friendly API the rest of the codebase already expects: {r,g,b,a} colour arrays, default fg/bg colours, the convenience primitives (line, circle), blit with table options, and send/display helpers that hand the pixels to the Kitty protocol.

Use canvas:get(x, y) to read a pixel back.

Functions

NameSignature
new_canvasnew_canvas(config) -> canvas

new_canvas(config) -> canvas

Create a new pixel canvas for drawing and displaying images

Returns a canvas object with drawing and display methods.

Config fields:

The canvas is pre-filled with colors.bg on creation.