Gradient
import { Gradient } from 'pixi-silk';
Base class of all gradients. Stops are interpolated premultiplied (OKLab by default), baked into a shared half-float atlas and dithered when sampled, which hides banding.
A gradient is read when a shape is filled or stroked. Changing its points later does not change shapes already painted: paint them again. The atlas holds 256 ramps in use at once, and gradients with the same stops, space and easing share one.
Extended by#
Constructors#
Constructor#
new Gradient(options: GradientOptions): Gradient;
Parameters#
| Parameter | Type |
|---|---|
options | GradientOptions |
Returns#
Gradient
Properties#
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
easing | readonly | Easing | How the ramp moves between stops. | gradient.ts:149 |
extend | readonly | ExtendMode | What the gradient does outside 0..1. | gradient.ts:151 |
space | readonly | ColorSpace | Interpolation space. | gradient.ts:147 |
units | readonly | GradientUnits | Coordinates of the gradient’s points and radii. | gradient.ts:153 |