@pbroom/color-kit/interopReaders
fromSrgbArray
Read a color from gamma-encoded sRGB [r, g, b] (0–1) stored in any array-like (number[], Float32Array, ...). Alpha is 1; use fromSrgbArray4 to read [c0, c1, c2, alpha].
import { fromSrgbArray } from '@pbroom/color-kit/interop';readers.ts:67function fromSrgbArray(
array: ArrayLike<number>,
offset?: number,
): Color;Parameters
Returns
ColorA new Color (OKLCH).
Example
const color = fromSrgbArray(buffer, 6);Also exported from
@pbroom/color-kitthe same declaration, re-exported