Skip to content
GitHub repository
Function

linear

function linear(stops: StopInput[], options?: Omit<LinearGradientOptions, "stops">): LinearGradient;

Linear gradient. from / to default to top and bottom of the shape’s box (units: 'shape').

Parameters#

ParameterType
stopsStopInput[]
optionsOmit<LinearGradientOptions, "stops">

Returns#

LinearGradient

Example#

g.roundRect(0, 0, 200, 60, 16).fill(linear([0x0a84ff, 0xbf5af2], { from: [0, 0], to: [1, 1] }));