Skip to content

@orillusion/core


Class: ColorGradient

Defined in: src/math/ColorGradient.ts:7

A color gradient that interpolates between an ordered array of colors.

Constructors

Constructor

new ColorGradient(array): ColorGradient

Defined in: src/math/ColorGradient.ts:11

Creates a gradient from an ordered array of colors.

Parameters

array

Color[]

Returns

ColorGradient

Methods

getColor()

getColor(p): Color

Defined in: src/math/ColorGradient.ts:16

Returns the interpolated color at the normalized position p (0 to 1).

Parameters

p

number

Returns

Color

Released under the MIT License