API reference

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

C

classColorOverSpeed

@codexo/exojs-particles / particles / stable

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.

3
props
5
methods
0
events
Import
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.

Constructors 1
new(gradient: ColorGradient, minSpeed: number, maxSpeed: number): ColorOverSpeed
Methods 5
apply(system: ParticleSystem, _dt: number): void
destroy(): void
uploadTextures(device: GPUDevice, textures: ReadonlyMap<string, GPUTexture>): void
wgsl(): WgslContribution
writeUniforms(view: DataView, offset: number): void
Properties 3
gradient: ColorGradient
maxSpeed: number
minSpeed: number
Source