MeshGradient
import { MeshGradient } from 'pixi-silk';
A smooth colour surface through a grid of control colours, like a gradient mesh in Illustrator.
Colours blend with a bicubic spline in its space (OKLab by default), so falloffs stay soft in
both directions. The surface is baked at 16x16 samples.
Create it with mesh.
Extends#
Constructors#
Constructor#
new MeshGradient(
cols: number,
rows: number,
colors: MeshColorInput[],
options?: MeshGradientOptions
): MeshGradient;
Parameters#
| Parameter | Type |
|---|---|
cols | number |
rows | number |
colors | MeshColorInput[] |
options | MeshGradientOptions |
Returns#
MeshGradient
Overrides#
Properties#
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
cols | readonly | number | Columns of control colours. | - | gradient.ts:492 |
easing | readonly | Easing | How the ramp moves between stops. | Gradient.easing | gradient.ts:149 |
extend | readonly | ExtendMode | What the gradient does outside 0..1. | Gradient.extend | gradient.ts:151 |
from | public | Vec2 | Top-left corner of the grid. | - | gradient.ts:496 |
rows | readonly | number | Rows of control colours. | - | gradient.ts:494 |
space | readonly | ColorSpace | Interpolation space. | Gradient.space | gradient.ts:147 |
to | public | Vec2 | Bottom-right corner of the grid. | - | gradient.ts:498 |
units | readonly | GradientUnits | Coordinates of the gradient’s points and radii. | Gradient.units | gradient.ts:153 |