pt(cx: number, cy: number, r: number, a: number) → void
| arg | type | description |
|---|
| cx | number | |
| cy | number | |
| r | number | |
| a | number | |
arcPoints(cx: number, cy: number, r: number, a0: number, a1: number, step: number?) → void
| arg | type | description |
|---|
| cx | number | |
| cy | number | |
| r | number | |
| a0 | number | |
| a1 | number | |
| step | number? | |
arc(c: { any }, cx: number, cy: number, r: number, a0: number, a1: number, color: string, width: number) → void
| arg | type | description |
|---|
| c | { any } | |
| cx | number | |
| cy | number | |
| r | number | |
| a0 | number | |
| a1 | number | |
| color | string | |
| width | number | |
band(c: { any }, cx: number, cy: number, r0: number, r1: number, a0: number, a1: number, fill: string) → void
A filled ring segment between radii r0 and r1 (a thick arc with clean ends).
| arg | type | description |
|---|
| c | { any } | |
| cx | number | |
| cy | number | |
| r0 | number | |
| r1 | number | |
| a0 | number | |
| a1 | number | |
| fill | string | |
gradArc(c: { any }, cx: number, cy: number, r: number, a0: number, a1: number, colors: { string }, width: number) → void
An arc whose colour runs through `colors` (a list of hex strings) from a0 to a1.
| arg | type | description |
|---|
| c | { any } | |
| cx | number | |
| cy | number | |
| r | number | |
| a0 | number | |
| a1 | number | |
| colors | { string } | |
| width | number | |
line(c: { any }, x0: number, y0: number, x1: number, y1: number, color: string, width: number) → void
| arg | type | description |
|---|
| c | { any } | |
| x0 | number | |
| y0 | number | |
| x1 | number | |
| y1 | number | |
| color | string | |
| width | number | |
tick(c: { any }, cx: number, cy: number, r0: number, r1: number, a: number, color: string, width: number) → void
| arg | type | description |
|---|
| c | { any } | |
| cx | number | |
| cy | number | |
| r0 | number | |
| r1 | number | |
| a | number | |
| color | string | |
| width | number | |
needle(c: { any }, cx: number, cy: number, a: number, len: number, tail: number, w: number, color: string, glow: string?) → void
A tapered needle: tip `len` out along angle a, `tail` behind the hub, `w` wide at the hub.
| arg | type | description |
|---|
| c | { any } | |
| cx | number | |
| cy | number | |
| a | number | |
| len | number | |
| tail | number | |
| w | number | |
| color | string | |
| glow | string? | |
circle(c: { any }, cx: number, cy: number, r: number, fill: string?, stroke: string?, width: number?) → void
| arg | type | description |
|---|
| c | { any } | |
| cx | number | |
| cy | number | |
| r | number | |
| fill | string? | |
| stroke | string? | |
| width | number? | |
rect(c: { any }, x: number, y: number, w: number, h: number, fill: string?, stroke: string?, width: number?, rounding: number?) → void
| arg | type | description |
|---|
| c | { any } | |
| x | number | |
| y | number | |
| w | number | |
| h | number | |
| fill | string? | |
| stroke | string? | |
| width | number? | |
| rounding | number? | |
poly(c: { any }, pts: { { number } }, fill: string?, stroke: string?, width: number?) → void
| arg | type | description |
|---|
| c | { any } | |
| pts | { { number } } | |
| fill | string? | |
| stroke | string? | |
| width | number? | |
text(c: { any }, x: number, y: number, s: string, color: string, size: number, font: string?, align: string?) → void
Text centred on (x, y) by default; align "leftCenter" / "rightCenter" anchor the other edges.
| arg | type | description |
|---|
| c | { any } | |
| x | number | |
| y | number | |
| s | string | |
| color | string | |
| size | number | |
| font | string? | |
| align | string? | |
hexToRgb(h: string) → void
| arg | type | description |
|---|
| h | string | |
rgbToHex(r: number, g: number, b: number, a: number?) → string
| arg | type | description |
|---|
| r | number | |
| g | number | |
| b | number | |
| a | number? | |
cl(v: number) → number return math
| arg | type | description |
|---|
| v | number | |
mix(a: string, b: string, t: number) → string
| arg | type | description |
|---|
| a | string | |
| b | string | |
| t | number | |
ramp(colors: { string }, t: number) → string
The colour at t (0..1) along a list of evenly spaced stops.
| arg | type | description |
|---|
| colors | { string } | |
| t | number | |
alpha(h: string, a: number) → string
Same colour at a new alpha (0..1).
| arg | type | description |
|---|
| h | string | |
| a | number | |
segWidth(h: number) → number
Width of one seven-segment cell of height h (the advance is width + gap).
| arg | type | description |
|---|
| h | number | |
seg7(c: { any }, x: number, y: number, h: number, s: string, on: string, off: string?, slant: number?, glow: string?) → void
Draws `s` in seven-segment digits, top-left at (x, y), each digit h tall.
Unlit segments draw in `off` (nil skips them), so the display reads as a real VFD/LCD.
| arg | type | description |
|---|
| c | { any } | |
| x | number | |
| y | number | |
| h | number | |
| s | string | |
| on | string | |
| off | string? | |
| slant | number? | |
| glow | string? | |
P(px: number, py: number) → void
| arg | type | description |
|---|
| px | number | |
| py | number | |
hseg(x0: number, x1: number, yy: number) → void
| arg | type | description |
|---|
| x0 | number | |
| x1 | number | |
| yy | number | |
vseg(xx: number, y0: number, y1: number) → void
| arg | type | description |
|---|
| xx | number | |
| y0 | number | |
| y1 | number | |
seg7Width(h: number, n: number) → number
| arg | type | description |
|---|
| h | number | |
| n | number | |
pixWidth(px: number, s: string) → number
| arg | type | description |
|---|
| px | number | |
| s | string | |
pixText(c: { any }, x: number, y: number, px: number, s: string, color: string, shadow: string?) → void
Pixel text, top-left at (x, y); each font pixel is `px` square. `shadow` draws a hard 1-pixel drop.
| arg | type | description |
|---|
| c | { any } | |
| x | number | |
| y | number | |
| px | number | |
| s | string | |
| color | string | |
| shadow | string? | |
draw(ox: number, oy: number, col: string) → void
| arg | type | description |
|---|
| ox | number | |
| oy | number | |
| col | string | |