API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classColorGradient
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.
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.
new(keys: readonly ColorGradientKey[]): ColorGradient evaluate(t: number, out: Color): Color evaluateRgba(t: number): number