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#
| Name | Type |
|---|---|
...keys | SplineKey<Color>[] |
Inherited from#
Spline<Color>.constructor
Defined in#
Methods#
evaluate#
â–¸ evaluate(time): Color
Evaluates the spline at the given time.
Parameters#
| Name | Type |
|---|---|
time | number |
Returns#
Inherited from#
Spline.evaluate
Defined in#
simple#
â–¸ Static simple(...colors): Gradient
Returns a gradient with evenly spaced keys from the given colors.
Parameters#
| Name | Type |
|---|---|
...colors | Color[] |
Returns#
Defined in#
solid#
â–¸ Static solid(color): Gradient
Returns a solid gradient from the given color.
Parameters#
| Name | Type |
|---|---|
color | Color |