API
What methods and properties are available in Mesh Gradient and how to use them.
MeshGradient
The main instance API.
import { MeshGradient } from '@mesh-gradient/core';
const gradient = new MeshGradient();
MeshGradientOptions
Options for .init()
and .update()
methods.
import { MeshGradientOptions } from '@mesh-gradient/core';
const options: MeshGradientOptions = {
colors: ['#000000', '#ffffff', '#000000', '#ffffff'],
};
Init Options
Type MeshGradientInitOptions
contains additional options for .init()
method. Not used in .update()
method.
Update Options
Type MeshGradientUpdateOptions
contains additional options for .update()
method.
Name | Type | Default |
---|---|---|
transition | boolean Enable fade transition when updating gradient. | true |
transitionDuration | number Duration of fade transition in milliseconds. | 300 |