API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classColorOverSpeed
Per-frame, per-particle color sampler driven by velocity magnitude rather than lifetime ratio. Each live particle's tint is set to the gradient evaluated at `clamp((|velocity| - minSpeed) / (maxSpeed - minSpeed), 0, 1)`. Use cases: heat-mapping (slow=blue, fast=red), velocity-tinted trails, speed-gated highlights. GPU-eligible: gradient uploaded as a 256-tap 1D RGBA8 texture, sampled with linear filtering. Replaces the full color word — pair with a separate AlphaFadeOverLifetime after this module if you want to keep alpha controlled by lifetime.
import { ColorOverSpeed } from '@codexo/exojs-particles' Per-frame, per-particle color sampler driven by velocity magnitude rather than lifetime ratio. Each live particle's tint is set to the gradient evaluated at `clamp((|velocity| - minSpeed) / (maxSpeed - minSpeed), 0, 1)`.
Use cases: heat-mapping (slow=blue, fast=red), velocity-tinted trails, speed-gated highlights.
GPU-eligible: gradient uploaded as a 256-tap 1D RGBA8 texture, sampled with linear filtering. Replaces the full color word — pair with a separate AlphaFadeOverLifetime after this module if you want to keep alpha controlled by lifetime.
new(gradient: ColorGradient, minSpeed: number, maxSpeed: number): ColorOverSpeed apply(system: ParticleSystem, _dt: number): void destroy(): void uploadTextures(device: GPUDevice, textures: ReadonlyMap<string, GPUTexture>): void wgsl(): WgslContribution writeUniforms(view: DataView, offset: number): void gradient: ColorGradient maxSpeed: number minSpeed: number