API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classColorGradient

@codexo/exojs-particles / particles / stable

Piecewise-linear color gradient sampled by lifetime ratio `t` in `[0, 1]`. Keyframes are stored sorted by `t`; sampling outside the range returns the nearest endpoint color. Like Curve, the last accessed segment is cached so monotonically advancing `t` is O(1) amortised. Two output paths: - evaluate - writes into a `Color` instance (own scratch by default). - evaluateRgba - returns the packed `0xAABBGGRR` u32 directly, skipping the Color object. Use this in tight per-particle inner loops that write into a `Uint32Array` instance buffer.

0
props
2
methods
0
events
Import
import { ColorGradient } from '@codexo/exojs-particles'

Piecewise-linear color gradient sampled by lifetime ratio `t` in `[0, 1]`. Keyframes are stored sorted by `t`; sampling outside the range returns the nearest endpoint color. Like Curve, the last accessed segment is cached so monotonically advancing `t` is O(1) amortised.

Two output paths: - evaluate - writes into a `Color` instance (own scratch by default). - evaluateRgba - returns the packed `0xAABBGGRR` u32 directly, skipping the Color object. Use this in tight per-particle inner loops that write into a `Uint32Array` instance buffer.

Constructors1
Methods2
evaluateRgba(t: number): number
Returns the gradient sample at t packed into a single 32-bit RGBA integer (0xAABBGGRR). Avoids the Color object on the hot path; suitable for direct write into a Uint32Array instance buffer.
Source