ColorStops

Represents an array of color stops for gradients.

ColorStops type

Represents an array of color stops for gradients.

Signature:

type ColorStops = ReadonlyArray<{
  readonly color: Color;
  readonly offset: number;
  readonly opacity: number;
}>;

References: Color

Example

// Red to blue gradient
const gradientStops: ColorStops = [
  { color: { r: 255, g: 0, b: 0 }, offset: 0, opacity: 1 },
  { color: { r: 0, g: 0, b: 255 }, offset: 1, opacity: 1 },
];
Last updated: August 5, 2026 at 11:47 AMEdit this page