@pbroom/color-kit/interopReaders

fromOklchArray

Read a color from OKLCH [l, c, h] stored in any array-like (number[], Float32Array, ...). Alpha is 1; use fromOklchArray4 to read [c0, c1, c2, alpha].

functionimport { fromOklchArray } from '@pbroom/color-kit/interop';readers.ts:214
function fromOklchArray(
  array: ArrayLike<number>,
  offset?: number,
): Color;

Parameters

arrayArrayLike<number>
Source array.
offset?numberdefault 0
Index in array of the first component.

Returns

ColorA new Color (OKLCH).

Example

TypeScript
const color = fromOklchArray(buffer, 6);

Also exported from