Stroke inputs reference
The stroke parameter grid's input columns and the matching
stroke.* expression variables. Grid columns receive normalized
0–1 values; expression columns
receive the raw values.
Device inputs
| Grid column | Expression | Raw value | Normalized |
|---|---|---|---|
| Pressure | stroke.pressure |
stylus tip pressure 0–1 (mouse = 1) | identity |
| Tilt altitude | stroke.tiltAltitude |
pen lean away from vertical, 0 upright – 1 flat | identity |
| Tilt azimuth | stroke.tiltAzimuth |
compass direction of the lean, 0–1 wraps | identity |
| Barrel rotation | stroke.barrelRotation |
pen spin about its long axis, 0–1 = 0–360° | identity |
| Tangential | stroke.tangential |
finger-wheel pressure | identity |
Derived inputs
| Grid column | Expression | Raw value | Normalized |
|---|---|---|---|
| Time | stroke.time |
seconds since stroke start | t/(t+3s) |
| Length | stroke.length |
stroke arc length, px | L/(L+512px) |
| Direction | stroke.direction |
angle of the last movement, radians 0–2π (holds until you move) | angle/2π |
| Speed | stroke.speed |
distance between the last two input events, px | d/(d+32px) |
| Random 1–3 | stroke.random1..3 |
per-dab uniform 0–1; deterministic (the seed is journaled, replays are exact) | identity |
| Opacity under | stroke.opacityUnder |
committed alpha under the cursor, sample-and-hold | identity |
Normalization is the monotone soft-saturation x/(x+k) — unbounded
inputs stay safe, and k is the raw value that maps to 0.5.
Constants and globals (expressions only)
| Expression | Value |
|---|---|
math.pi, math.tau, math.e |
the constants |
global.time |
seconds since app start (monotonic); replays with replay-time values — documented lossy |
Functions
Expressions have the full GLSL ES math builtin set — sin, cos,
pow, mix, clamp, smoothstep, length, fract, and the rest
of the engine's table (the editor's completion popup is generated
from that table, so it is always complete).