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 ColorGradientKeyA keyframe in a ColorGradient: color at lifetime ratio `t` in `[0, 1]`.[]): ColorGradientevaluate(t: number, out: Color32-bit RGBA color value with channel-wise accessors. Red, green, and blue are integers in 0..255; alpha is a float in 0..1. Out-of-range values are saturated o…): Color32-bit RGBA color value with channel-wise accessors. Red, green, and blue are integers in 0..255; alpha is a float in 0..1. Out-of-range values are saturated o…evaluateRgba(t: number): number