API reference

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

C

classGradient

@codexo/exojs / rendering / stable

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.

2
props
10
methods
0
events
Import
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.

Constructors1
new(stops: readonly GradientStop[]): Gradient
Methods10
_copyGeometry(source: this): void
Copy the concrete subclass geometry from a same-type source.
_geometryEquals(other: Gradient): boolean
Compare the concrete subclass geometry against other. Only invoked once Gradient.equals has confirmed both sides share the same GradientType, so implementations may narrow other accordingly.
clone(): this
Deep-clone into a new instance of the same concrete gradient type.
copy(source: this): this
Copy every value (stops and geometry) from a same-type source into this instance, replacing its current state. Returns this for chaining.
destroy(): void
equals(other: Gradient): boolean
Structural value equality: same GradientType, same ordered stops (offset and Color), and same subclass geometry.
resolveT(u: number, v: number): number
sampleAt(t: number, out: Float32Array): void
Shared stop sampling logic ported from the legacy GLSL implementation.
Properties2
Concrete gradient kind, e.g. 'linear' or 'radial'.
stops: readonly GradientStop[]
Source