Skip to main content

Class: Gradient

components.Gradient

Represents a gradient that can be used to interpolate between multiple color.

Hierarchy#

  • Spline<Color>

    Gradient

Constructors#

constructor#

new Gradient(...keys)

Creates a new spline instance, using the specified keys. Note that you have to pass at least one key.

Parameters#

NameType
...keysSplineKey<Color>[]

Inherited from#

Spline<Color>.constructor

Defined in#

components/spline.ts:26

Methods#

evaluate#

evaluate(time): Color

Evaluates the spline at the given time.

Parameters#

NameType
timenumber

Returns#

Color

Inherited from#

Spline.evaluate

Defined in#

components/spline.ts:48


simple#

Static simple(...colors): Gradient

Returns a gradient with evenly spaced keys from the given colors.

Parameters#

NameType
...colorsColor[]

Returns#

Gradient

Defined in#

components/gradient.ts:25


solid#

Static solid(color): Gradient

Returns a solid gradient from the given color.

Parameters#

NameType
colorColor

Returns#

Gradient

Defined in#

components/gradient.ts:18