API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classGradient
CPU-rasterized gradient base. A Color-like paint value (not a Drawable): it owns a normalized list of color stops plus subclass geometry and supports the value-object contract — Gradient.clone, Gradient.copy, and Gradient.equals. Stops are cloned on the way in, clamped to `0..1`, and kept sorted by offset. Convert a gradient into a sampleable DataTexture with Gradient.toTexture; wrap that texture in a `Sprite`/`Mesh` to draw it.
import { Gradient } from '@codexo/exojs' CPU-rasterized gradient base. A Color-like paint value (not a Drawable): it owns a normalized list of color stops plus subclass geometry and supports the value-object contract — Gradient.clone, Gradient.copy, and Gradient.equals. Stops are cloned on the way in, clamped to `0..1`, and kept sorted by offset.
Convert a gradient into a sampleable DataTexture with Gradient.toTexture; wrap that texture in a `Sprite`/`Mesh` to draw it.
new(stops: readonly GradientStop[]): Gradient _copyGeometry(source: this): void _geometryEquals(other: Gradient): boolean clone(): this copy(source: this): this destroy(): void equals(other: Gradient): boolean resolveT(u: number, v: number): number sampleAt(t: number, out: Float32Array): void toTexture(width: number, height: number, options?: GradientToTextureOptions & object): DataTexture<"rgba8"> toTexture(width: number, height: number, options: GradientToTextureOptions & object): DataTexture<"rgba32f"> type: GradientType stops: readonly GradientStop[]