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