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): booleanclone(): thiscopy(source: this): thisdestroy(): voidequals(other: Gradient): booleanresolveT(u: number, v: number): numbersampleAt(t: number, out: Float32Array): voidtoTexture(width: number, height: number, options?: GradientToTextureOptions & { format?: Rgba8 }): DataTextureA 2D texture whose pixels live in a CPU-side typed array. Mutate the `buffer` directly and call commit to upload the whole array, or commitRect to upload a sub…<Rgba8>toTexture(width: number, height: number, options: GradientToTextureOptions & { format: Rgba32F }): DataTextureA 2D texture whose pixels live in a CPU-side typed array. Mutate the `buffer` directly and call commit to upload the whole array, or commitRect to upload a sub…<Rgba32F>stops: readonly GradientStop[]