Skip to main content

Module drawing

Module drawing 

Source
Expand description

Vector drawing primitives: paths, fills, strokes, caps, and gradients.

Modules§

path_smoothing
path_trim
stroke_utils

Structs§

Depth
Logical scene depth for lighting calculations.
Fill
One interior paint layer. Index zero in an element’s fill stack is topmost.
GradientStop
A color stop for a gradient fill, defined by a position (% or px) and a color.
LinearGradient
Describes a linear gradient fill with a start and end point, and a list of color stops.
MaterialParams
Tunable response parameters for a light-reactive vector material.
MeshGradient
Smooth mesh paint with 2–8 equally sized rows, each containing 2–8 anchors. Automatic shared Bézier controls interpolate the anchors and their premultiplied encoded-sRGB colors. Outside the covered mesh the paint is transparent. Folded patches replace earlier patches in row-major order. Supported by the WGPU renderer. Animate positions/colors to morph; whole Paint transitions remain crossfades.
MeshPoint
A colored anchor in a MeshGradient. Position uses ordinary pixels, percentages, or combined units, relative to the complete consumer geometry’s paint bounds. Rows describe connectivity; anchors in a row may have different y coordinates.
RadialGradient
A focal radial gradient, growing from start to the circle at end with radius.
ResolvedMaterialParams
Plain material coefficients for one settled drawing operation.
ResolvedRadialGradient
Runtime geometry shared by radial color fills and painted alpha masks. Coordinates are local logical pixels, before the element’s affine transform.
ResolvedStroke
Plain drawing values captured before entering a rendering backend. Backends never read live shared properties while recording a frame.
SceneAmbientLight
Resolved ambient light for one logical canvas layer.
SceneLight
Resolved light contribution for one logical canvas layer.
SceneLighting
Resolved lighting state for one logical canvas layer.
Stroke
One centered outline layer, drawn above every interior fill. Index zero in an element’s stroke stack is topmost.
Vector3
A three-dimensional vector in logical scene space.

Enums§

LightShape
Shape of a light contribution in logical scene space.
Material
Light-reactive surface response for vector primitives.
NavigationTarget
Describes where to open new windows or tabs when navigating to a URL from a Link node.
Paint
Describes how to fill vector geometry. Solid fills interpolate their RGBA channels. Other pairs crossfade sampled paints in premultiplied RGBA, preserving each gradient’s geometry and stops.
PathElement
Describes a single element of a vector path, such as a line, a point, or curve segment.
PathSmoothing
Controls optional curve smoothing for path geometry before tessellation.
ResolvedMaterial
Material response with no live property handles.
StrokeCap
Controls how an open stroke terminates at the exposed endpoints of a path.
StrokeJoin
Controls how stroke segments are joined at path vertices.

Functions§

paint_bounds
Stable local reference frame for paint, independent of outline width and reveal. A collapsed axis gets a centered one-logical-pixel span without adding coverage.