Skip to content
pixi-silk
GitHub repository
Class

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#

ParameterType
colsnumber
rowsnumber
colorsMeshColorInput[]
optionsMeshGradientOptions

Returns#

MeshGradient

Overrides#

Gradient.constructor

Properties#

PropertyModifierTypeDescriptionInherited fromDefined in
colsreadonlynumberColumns of control colours.-gradient.ts:492
easingreadonlyEasingHow the ramp moves between stops.Gradient.easinggradient.ts:149
extendreadonlyExtendModeWhat the gradient does outside 0..1.Gradient.extendgradient.ts:151
frompublicVec2Top-left corner of the grid.-gradient.ts:496
rowsreadonlynumberRows of control colours.-gradient.ts:494
spacereadonlyColorSpaceInterpolation space.Gradient.spacegradient.ts:147
topublicVec2Bottom-right corner of the grid.-gradient.ts:498
unitsreadonlyGradientUnitsCoordinates of the gradient’s points and radii.Gradient.unitsgradient.ts:153