Skip to content
pixi-silk
GitHub repository
Class

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#

ParameterType
optionsGradientOptions

Returns#

Gradient

Properties#

PropertyModifierTypeDescriptionDefined in
easingreadonlyEasingHow the ramp moves between stops.gradient.ts:149
extendreadonlyExtendModeWhat the gradient does outside 0..1.gradient.ts:151
spacereadonlyColorSpaceInterpolation space.gradient.ts:147
unitsreadonlyGradientUnitsCoordinates of the gradient’s points and radii.gradient.ts:153