Skip to content

Wiggle API / GradientFn

Interface: GradientFn() ​

A diagonal linear gradient from from to to.

GradientFn(from, to): Gradient

A two-stop linear gradient from one color to another.

Parameters ​

from ​

string

to ​

string

Returns ​

Gradient

Methods ​

linear() ​

linear(stops, opts?): Gradient

A multi-stop linear gradient. from and to are the start and end points, in fractions (0...1) of the painted shape's box; the default runs left to right.

Parameters ​

stops ​

GradientStop[]

opts? ​
from? ​

[number, number]

to? ​

[number, number]

Returns ​

Gradient


radial() ​

radial(stops, opts?): Gradient

A multi-stop radial gradient. center, radius, and the optional focal highlight are in fractions (0...1) of the shape's box; the default is centered with radius 0.5.

Parameters ​

stops ​

GradientStop[]

opts? ​
center? ​

[number, number]

focal? ​

[number, number]

radius? ​

number

Returns ​

Gradient