Skip to main content

Interface: BrushParamConfig

Defined in: src/lib/brushes/types/index.ts:49

Controls how a brush parameter varies for each stamp along a stroke: its range (min to max), and the sources that pick a value in it. All source ranges are fractions from 0 to 1.

Each source turned on gives a share, from its input (0–1) through its profile graph (see applyProfile):

  • Randomise: between minRandomise and maxRandomise, from a random number
  • Pressure: between minPressure and maxPressure, from the pen's pressure (full for other devices)
  • Tilt: between minTilt and maxTilt, from the pen's tilt (0 = upright, 1 = flat; full for other devices)

The shares multiply into one (1 when no source is on), which sets the value between the range's ends:

  • Scale parameters (width, height, alpha, …): from value × min to the value.
  • Angle parameters (rotation, hue): from value + min to value + max degrees.
  • Offset parameters (offsetX, offsetY): from value + min to value + max pixels.

Settings saved without min and max work as before ranges: scale from 0, angle from 0 to 360°; with tilt on, the rotation follows the direction the pen leans (like a calligraphy nib); offsets scatter up to the share × size in a random direction.

Example​

// Width from half to full size, larger the harder the pen presses
const widthConfig: BrushParamConfig = { min: 0.5, usePressure: true, minPressure: 0, maxPressure: 1 };

Properties​

max?​

optional max?: number

Defined in: src/lib/brushes/types/index.ts:108

The range's high end, for angle (degrees added to the value) and offset (pixels) parameters


maxPressure?​

optional maxPressure?: number

Defined in: src/lib/brushes/types/index.ts:79

Factor at full pressure (0–1)

Default​

1

maxRandomise?​

optional maxRandomise?: number

Defined in: src/lib/brushes/types/index.ts:64

Highest random factor (0–1)

Default​

1

maxTilt?​

optional maxTilt?: number

Defined in: src/lib/brushes/types/index.ts:94

Factor when the pen is flat (0–1)

Default​

1

min?​

optional min?: number

Defined in: src/lib/brushes/types/index.ts:106

The range's low end: a fraction of the value for scale parameters (0–1), degrees added to it for angle parameters, or pixels for offset parameters


minPressure?​

optional minPressure?: number

Defined in: src/lib/brushes/types/index.ts:74

Factor at the lightest pressure (0–1)

Default​

0

minRandomise?​

optional minRandomise?: number

Defined in: src/lib/brushes/types/index.ts:59

Lowest random factor (0–1)

Default​

1

minTilt?​

optional minTilt?: number

Defined in: src/lib/brushes/types/index.ts:89

Factor when the pen is upright (0–1)

Default​

0

pressureProfile?​

optional pressureProfile?: ProfilePoint[]

Defined in: src/lib/brushes/types/index.ts:110

Pressure's own profile graph (instead of profile)


pressureProfileId?​

optional pressureProfileId?: string

Defined in: src/lib/brushes/types/index.ts:112

The ID of the profile graph pressureProfile came from


profile?​

optional profile?: ProfilePoint[]

Defined in: src/lib/brushes/types/index.ts:99

The profile graph the input (pressure, tilt or the random number) goes through before setting the factor between its min and max, e.g. so a light touch goes most of the way (see applyProfile). A straight line by default.


profileId?​

optional profileId?: string

Defined in: src/lib/brushes/types/index.ts:101

The ID of the profile graph profile came from (a preset's or one of the user's), to show its name


randomiseProfile?​

optional randomiseProfile?: ProfilePoint[]

Defined in: src/lib/brushes/types/index.ts:118

Randomise's own profile graph (instead of profile)


randomiseProfileId?​

optional randomiseProfileId?: string

Defined in: src/lib/brushes/types/index.ts:120

The ID of the profile graph randomiseProfile came from


tiltProfile?​

optional tiltProfile?: ProfilePoint[]

Defined in: src/lib/brushes/types/index.ts:114

Tilt's own profile graph (instead of profile)


tiltProfileId?​

optional tiltProfileId?: string

Defined in: src/lib/brushes/types/index.ts:116

The ID of the profile graph tiltProfile came from


usePressure?​

optional usePressure?: boolean

Defined in: src/lib/brushes/types/index.ts:69

Vary the parameter with pen pressure, when the device provides it

Default​

false

useRandomise?​

optional useRandomise?: boolean

Defined in: src/lib/brushes/types/index.ts:54

Vary the parameter randomly for each stamp, between minRandomise and maxRandomise

Default​

false

useTilt?​

optional useTilt?: boolean

Defined in: src/lib/brushes/types/index.ts:84

Vary the parameter with pen tilt, when the device provides it

Default​

false