Interface: BrushConfig
Defined in: src/lib/brushes/types/index.ts:124
A brush's settings: what a brush preset holds (its content), and what the brush engine draws with
Properties
alpha?
optionalalpha?:number
Defined in: src/lib/brushes/types/index.ts:181
Initial alpha value (0–1)
Default
1
alphaConfig?
optionalalphaConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:183
How alpha varies per stamp (scale; see BrushParamConfig)
blue?
optionalblue?:string|number
Defined in: src/lib/brushes/types/index.ts:174
Initial colour blue value (0–255)
Default
0
blueConfig?
optionalblueConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:176
How blue varies per stamp (scale; see BrushParamConfig)
colourMode?
optionalcolourMode?:ColourMode
Defined in: src/lib/brushes/types/index.ts:134
Brush colour mode affects how colour settings are applied.
Default
ColourMode.HSL
constrainProportions?
optionalconstrainProportions?:boolean
Defined in: src/lib/brushes/types/index.ts:199
Keep the width-to-height ratio when the size changes
green?
optionalgreen?:string|number
Defined in: src/lib/brushes/types/index.ts:167
Initial colour green value (0–255)
Default
0
greenConfig?
optionalgreenConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:169
How green varies per stamp (scale; see BrushParamConfig)
height?
optionalheight?:number
Defined in: src/lib/brushes/types/index.ts:195
Default height in pixels (the user can change it from 1 to 256)
Default
1
heightConfig?
optionalheightConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:197
How height varies per stamp (scale; see BrushParamConfig)
hue?
optionalhue?:string|number
Defined in: src/lib/brushes/types/index.ts:139
Initial colour hue value (0–359)
Default
0
hueConfig?
optionalhueConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:141
How hue varies per stamp (angle: adds up to 360°; see BrushParamConfig)
image?
optionalimage?:string|Uint8Array<ArrayBufferLike>
Defined in: src/lib/brushes/types/index.ts:129
Brush shape: an image whose alpha values define the shape (its colours are ignored). A data URL string, or raw image file bytes. Defaults to a hard round shape.
lightness?
optionallightness?:string|number
Defined in: src/lib/brushes/types/index.ts:153
Initial colour lightness value (0–100)
Default
50
lightnessConfig?
optionallightnessConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:155
How lightness varies per stamp (scale; see BrushParamConfig)
offsetX?
optionaloffsetX?:number
Defined in: src/lib/brushes/types/index.ts:216
Horizontal offset of each stamp from the pointer, in pixels
Default
0
offsetXConfig?
optionaloffsetXConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:218
How offsetX varies per stamp (offset: scatters up to the factor × brush width either way; see BrushParamConfig)
offsetY?
optionaloffsetY?:number
Defined in: src/lib/brushes/types/index.ts:223
Vertical offset of each stamp from the pointer, in pixels
Default
0
offsetYConfig?
optionaloffsetYConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:225
How offsetY varies per stamp (offset: scatters up to the factor × brush height either way; see BrushParamConfig)
red?
optionalred?:string|number
Defined in: src/lib/brushes/types/index.ts:160
Initial colour red value (0–255)
Default
0
redConfig?
optionalredConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:162
How red varies per stamp (scale; see BrushParamConfig)
rotation?
optionalrotation?:number
Defined in: src/lib/brushes/types/index.ts:204
Rotation in degrees
Default
0
rotationConfig?
optionalrotationConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:206
How rotation varies per stamp (angle; see BrushParamConfig)
rotationFollowsLean?
optionalrotationFollowsLean?:boolean
Defined in: src/lib/brushes/types/index.ts:211
Turn each stamp to the direction the pen leans (like a calligraphy nib), adding any variation from rotationConfig
Default
false
sampleRate?
optionalsampleRate?:number
Defined in: src/lib/brushes/types/index.ts:231
How often (in milliseconds, 5–400) a new point is recorded while the pointer moves. Higher values record fewer points. No points are recorded while the pointer is still.
Default
10
saturation?
optionalsaturation?:string|number
Defined in: src/lib/brushes/types/index.ts:146
Initial colour saturation value (0–100)
Default
100
saturationConfig?
optionalsaturationConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:148
How saturation varies per stamp (scale; see BrushParamConfig)
smoothingType?
optionalsmoothingType?:SmoothingType
Defined in: src/lib/brushes/types/index.ts:236
How the line between recorded points is drawn
Default
SmoothingType.Linear
snapToPixelGrid?
optionalsnapToPixelGrid?:boolean
Defined in: src/lib/brushes/types/index.ts:247
Draw each stamp on whole pixels: its size is rounded to whole pixels and its top-left corner is rounded down
(Math.floor), so it never covers part of a pixel. Rotation other than a multiple of 90° still leaves the grid.
Default
false
spacing?
optionalspacing?:number
Defined in: src/lib/brushes/types/index.ts:241
Distance in pixels (0–200) between stamps of the brush shape along the line. 0 stamps at every pixel.
Default
5
width?
optionalwidth?:number
Defined in: src/lib/brushes/types/index.ts:188
Default width in pixels (the user can change it from 1 to 256)
Default
1
widthConfig?
optionalwidthConfig?:BrushParamConfig
Defined in: src/lib/brushes/types/index.ts:190
How width varies per stamp (scale; see BrushParamConfig)