weasel API - v0.8.0
    Preparing search index...

    Interface Stroke

    Stroke style: a FillStyle plus structural line parameters.

    interface Stroke {
        align?: StrokeAlign;
        cap?: "square" | "butt" | "round";
        dash?: number[];
        join?: "round" | "miter" | "bevel";
        miterLimit?: number;
        paint: FillStyle;
        varyingWidthJoinThreshold?: number;
        vertexColors?: number[];
        vertexWidths?: number[];
        width?: number;
    }
    Index

    Properties

    align?: StrokeAlign

    Where the stroke sits relative to the geometric edge. Default 'center'.

    cap?: "square" | "butt" | "round"
    dash?: number[]

    Per CanvasRenderingContext2D.setLineDash — empty/omitted = solid.

    join?: "round" | "miter" | "bevel"
    miterLimit?: number

    Miter join fallback threshold. When the miter length exceeds miterLimit * width / 2, the join falls back to a bevel. Default 10 (matching Canvas2D). SVG's default is 4; consumers that want SVG fidelity should set this explicitly when constructing strokes from SVG sources where the attribute was omitted.

    paint: FillStyle
    varyingWidthJoinThreshold?: number

    Max width ratio (greater / lesser) at which a non-bevel join is preserved when vertexWidths causes adjacent segments to differ. Beyond this ratio the join falls back to bevel. Default 1.5. Ignored when vertexWidths is absent.

    vertexColors?: number[]

    Per-anchor RGBA, flat (length = 4 × countPathAnchors(path)). Each value in 0..1. Arc-length interpolated across the tessellated ribbon between consecutive anchors. When set, paint is still required — its opacity (and color, as a placeholder) flow through the shader.

    vertexWidths?: number[]

    Per-anchor stroke width (length = countPathAnchors(path)). When set, the tessellator interpolates half-widths along each segment to produce a tapered ribbon. width is used as the fallback for any anchor whose entry is missing or non-finite. Pressure-driven pencil strokes use this; pair with pressureToWidth to derive widths from stylus input.

    Joins between adjacent segments whose widths differ by more than varyingWidthJoinThreshold (default 1.5×) are forced to bevel regardless of the join setting — miter math is unstable when widths vary across the corner; smooth round joins with mismatched widths are a future enhancement.

    width?: number