API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classLinearGradient
@codexo/exojs / rendering / stable
Linear gradient in UV space projected from `start` to `end`.
4
props
10
methods
0
events
Import
import { LinearGradient } from '@codexo/exojs'Linear gradient in UV space projected from `start` to `end`.
Constructors1
new(stops: readonly GradientStop[], start: readonly [number, number], end: readonly [number, number]): LinearGradientMethods10
_copyGeometry(source: LinearGradient): voidCopy the concrete subclass geometry from a same-type source.
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(): thisDeep-clone into a new instance of the same concrete gradient type.
copy(source: this): thisCopy every value (stops and geometry) from a same-type source into this instance, replacing its current state. Returns this for chaining.
destroy(): voidStructural value equality: same GradientType, same ordered stops (offset and Color), and same subclass geometry.
resolveT(u: number, v: number): numbersampleAt(t: number, out: Float32Array): voidShared stop sampling logic ported from the legacy GLSL implementation.
toTexture(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>Properties4
Concrete gradient kind, e.g. 'linear' or 'radial'.
end: readonly [number, number]Projection axis end point in UV space.
start: readonly [number, number]Projection axis start point in UV space.
stops: readonly GradientStop[]Source