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.

Constructors 1
new(stops: readonly GradientStop[]): Gradient
Methods 10
_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">
Properties 2
type: GradientType
stops: readonly GradientStop[]
Source