Function: stampParams()
stampParams(
preset,size,input,random?):StampParams
Defined in: src/lib/brushes/params/index.ts:139
Work out one stamp's size, rotation, offset and alpha from the preset, the user's chosen size and the input at that point
(see BrushParamConfig): each varied parameter's value is as far between its range's ends as its sources' share.
- Size and alpha go from
min× the value to the value (sizes at leastMIN_STAMP_SIZE). - Rotation goes from the angle +
minto the angle +maxdegrees (0 to 360 without a range). WithrotationFollowsLean, the direction the pen leans is added; without a range, tilt sets that direction instead. - Offsets go from
mintomaxpixels, added to the offset. Without a range, they scatter up to the share × the size in a random direction.
Parameters
preset
size
height
number
width
number
input
random?
RandomFn = Math.random
Returns
Example
stampParams(preset, { width: 20, height: 20 }, { isPen: true, pressure: 0.5 });