Implements

Indexable

[id: number]: number

Constructors

Properties

a: number
alpha: number
b: number
buf: NumericArray

Backing array / memory

l: number
length: 4
mode: "oklab"
offset: number

Start index in array

range: [ReadonlyVec, ReadonlyVec]

A tuple of [min, max] where both are vectors specifying the min/max channel ranges for this color type.

Remarks

Even though there're several color spaces which do not impose limits on at least some of their axes, the limits returned by this function indicate RGB "safe" colors and were determined by projecting all RGB colors into the color space used by this type.

stride: number

Step size between channels

xyz: [number, number, number]

Returns first 3 color components as tuple/vector. Not to be confused with XYZD50 or XYZD65 color modes.

Methods

  • Clamps all color channels so that colors is inside RGB gamut.

    Returns this

    Remarks

    Note: This is not a 100% guarantee, due to each channel being clamped individually based on pre-determined limits.

  • Returns true if this value equals o with optional allowance for given tolerance eps.

    Parameters

    • o: Oklab

      2nd value to test

    • Optional eps: number

      tolerance (usually defaults to DEFAULT_EPS)

    Returns boolean

  • Randomizes all color channels based on channel ranges defined for this color type (usually [0..1] interval). Alpha channel will remain untouched.

    Parameters

    • Optional rnd: IRandom

    Returns this

Generated using TypeDoc