@pbroom/color-kit/interopReaders

fromOklchArray4

Read a color from OKLCH [l, c, h] stored in any array-like (number[], Float32Array, ...). Alpha is read from the fourth component: [c0, c1, c2, alpha].

functionimport { fromOklchArray4 } from '@pbroom/color-kit/interop';readers.ts:232
function fromOklchArray4(
  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 = fromOklchArray4(buffer, 8);

Also exported from