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#
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
alignment? | number | "center" | "inside" | "outside" | inside | center | outside, or Pixi’s numeric alignment (1 inside, 0.5 center, 0 outside). |
alpha? | number | Opacity from 0 to 1. Default 1. | FillStyle.alpha | SilkGraphics.ts:84 |
blend? | "normal" | "add" | add paints plus-lighter: colours add to what is underneath, so overlapping glows bloom towards white. Default normal. | FillStyle.blend | SilkGraphics.ts:98 |
blur? | number | ProgressiveBlur | Gaussian blur (standard deviation, local units) for glows and soft shadows. A ProgressiveBlur changes the radius across the shape. | FillStyle.blur | SilkGraphics.ts:91 |
cap? | LineCap | Ends of open paths and of dashes. Default butt (Pixi default). | - | SilkGraphics.ts:142 |
color? | ColorSource | Colour, any Pixi ColorSource. With a gradient, it tints the gradient. | FillStyle.color | SilkGraphics.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? | boolean | On closed outlines stretch the pattern so it tiles without a seam. Default true. | - | SilkGraphics.ts:148 |
dashOffset? | number | Shifts the dash pattern along the path, in local units. Default 0. | - | SilkGraphics.ts:146 |
gradient? | Gradient | Gradient paint. color (if given) tints it. | FillStyle.gradient | SilkGraphics.ts:86 |
innerShadow? | InnerShadow | InnerShadow[] | One or more shadows inside closed shapes, drawn in order on top of the fill. | FillStyle.innerShadow | SilkGraphics.ts:100 |
join? | LineJoin | How 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? | number | A miter longer than this many half line widths becomes a bevel, as in Canvas 2D and SVG. Default 10. | - | SilkGraphics.ts:159 |
op? | ShapeOp | Combines 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.op | SilkGraphics.ts:117 |
spread? | number | Grows the shape by this many local units before it is blurred, like a Figma shadow spread. Negative shrinks it. | FillStyle.spread | SilkGraphics.ts:93 |
union? | boolean | Paints 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.union | SilkGraphics.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 |