Skip to main content

Interface: StrokeOptions

Defined in: src/lib/brushes/StrokeEngine/index.ts:17

Everything needed to draw one stroke

Properties​

colour​

colour: string

Defined in: src/lib/brushes/StrokeEngine/index.ts:25

Paint colour as a hex string (for the eraser, the colour it paints when the layer's alpha lock is on)


isPen​

isPen: boolean

Defined in: src/lib/brushes/StrokeEngine/index.ts:28

Whether input comes from a pen (enables pressure and tilt)


layer​

layer: default

Defined in: src/lib/brushes/StrokeEngine/index.ts:19

Layer the stroke is drawn on


mask?​

optional mask?: OffscreenCanvas

Defined in: src/lib/brushes/StrokeEngine/index.ts:30

Mask limiting where the stroke applies (its alpha scales the stroke), if a selection is active


mode​

mode: StrokeMode

Defined in: src/lib/brushes/StrokeEngine/index.ts:20


preset​

preset: BrushConfig

Defined in: src/lib/brushes/StrokeEngine/index.ts:21


random?​

optional random?: RandomFn

Defined in: src/lib/brushes/StrokeEngine/index.ts:34

Random source for parameter variation, instead of one from seed (replaceable for tests)


seed?​

optional seed?: number

Defined in: src/lib/brushes/StrokeEngine/index.ts:32

Seed for the stroke's random variation, to draw a recorded stroke the same way again (a new one by default)


size​

size: object

Defined in: src/lib/brushes/StrokeEngine/index.ts:23

Size chosen by the user

height​

height: number

width​

width: number


tip​

tip: default

Defined in: src/lib/brushes/StrokeEngine/index.ts:26