API reference

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

C

classColorOverLifetime

@codexo/exojs-particles / particles / stable

Per-frame, per-particle color sampler. Each live particle's tint is set to the gradient evaluated at the particle's current `elapsed / lifetime` ratio, packed RGBA. Replaces the per-particle blend of `ColorAffector` (legacy) with a multi-keyframe gradient. GPU-eligible: the gradient is uploaded once as a 256-tap 1D RGBA8 texture and sampled with linear filtering on the GPU.

1
props
5
methods
0
events
Import
import { ColorOverLifetime } from '@codexo/exojs-particles'

Per-frame, per-particle color sampler. Each live particle's tint is set to the gradient evaluated at the particle's current `elapsed / lifetime` ratio, packed RGBA. Replaces the per-particle blend of `ColorAffector` (legacy) with a multi-keyframe gradient.

GPU-eligible: the gradient is uploaded once as a 256-tap 1D RGBA8 texture and sampled with linear filtering on the GPU.

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