StrokeOptions

Options for creating a stroke.

StrokeOptions interface

Options for creating a stroke.

Signature:

interface StrokeOptions

Example

// Create a solid stroke
layer.createStroke({
  fill: { type: "SOLID", color: { r: 0, g: 0, b: 0 } },
  width: 2,
});

// Create a gradient stroke
layer.createStroke({
  fill: {
    type: "GRADIENT_LINEAR",
    stops: [
      { color: { r: 255, g: 0, b: 0 }, offset: 0, opacity: 1 },
      { color: { r: 0, g: 0, b: 255 }, offset: 1, opacity: 1 },
    ],
  },
  width: 5,
});

Properties

Property

Modifiers

Type

Description

fill

PaintOptions

The fill paint options for the stroke

width

number

The width of the stroke

Last updated: August 5, 2026 at 11:47 AMEdit this page