Skip to content
pixi-silk
GitHub repository
Interface

StrokeStyle

import type { StrokeStyle } from 'pixi-silk';

How a stroke is painted: width (or tapered widths), alignment, caps, dashes, plus everything in FillStyle.

Extends#

Properties#

PropertyTypeDescriptionInherited fromDefined in
alignment?number | "center" | "inside" | "outside"insidecenteroutside, or Pixi’s numeric alignment (1 inside, 0.5 center, 0 outside).
alpha?numberOpacity from 0 to 1. Default 1.FillStyle.alphaSilkGraphics.ts:84
blend?"normal" | "add"add paints plus-lighter: colours add to what is underneath, so overlapping glows bloom towards white. Default normal.FillStyle.blendSilkGraphics.ts:98
blur?number | ProgressiveBlurGaussian blur (standard deviation, local units) for glows and soft shadows. A ProgressiveBlur changes the radius across the shape.FillStyle.blurSilkGraphics.ts:91
cap?LineCapEnds of open paths and of dashes. Default butt (Pixi default).-SilkGraphics.ts:142
color?ColorSourceColour, any Pixi ColorSource. With a gradient, it tints the gradient.FillStyle.colorSilkGraphics.ts:82
dash?number | [number, number][dash, gap] or a single number for equal dash and gap. A 0 dash with round caps gives dots.-SilkGraphics.ts:144
dashFit?booleanOn closed outlines stretch the pattern so it tiles without a seam. Default true.-SilkGraphics.ts:148
dashOffset?numberShifts the dash pattern along the path, in local units. Default 0.-SilkGraphics.ts:146
gradient?GradientGradient paint. color (if given) tints it.FillStyle.gradientSilkGraphics.ts:86
innerShadow?InnerShadow | InnerShadow[]One or more shadows inside closed shapes, drawn in order on top of the fill.FillStyle.innerShadowSilkGraphics.ts:100
join?LineJoinHow segments meet at the corners of paths, polygons and sharp rects, triangles and stars. miter extends the outer edges to a point, bevel cuts the corner flat, round rounds it. Default miter, as in Canvas 2D, SVG and Pixi.-SilkGraphics.ts:154
miterLimit?numberA miter longer than this many half line widths becomes a bevel, as in Canvas 2D and SVG. Default 10.-SilkGraphics.ts:159
op?ShapeOpCombines the closed shapes of the active path into one shape. subtract takes every later shape out of the first one, intersect keeps what they all cover, and exclude keeps what an odd number of them cover. union is the same as union: true. A path from moveTo() or svgPath() takes part as one shape, even-odd. With stroke(), the stroke follows the outline of the result. See SilkGraphics.boolean for nested operations. Default none: every shape is painted on its own.FillStyle.opSilkGraphics.ts:117
spread?numberGrows the shape by this many local units before it is blurred, like a Figma shadow spread. Negative shrinks it.FillStyle.spreadSilkGraphics.ts:93
union?booleanPaints every closed shape of the active path as one shape: their distance fields merge, so overlaps are painted once and blur, anti-aliasing and opacity show no seam where they meet. Polygons from poly() and moveTo() join in too, each subpath on its own. With stroke(), the stroke follows the outline of the union, and open paths merge into one stroke. Default false.FillStyle.unionSilkGraphics.ts:108
width?number | number[]Default 1. On polylines an array tapers the stroke: [start, end] interpolates along the path length, one value per point sets each vertex.-SilkGraphics.ts:138