oklabPalette
oklabPalette(
pixels,options?):OklabPalette
Defined in: packages/math-color/src/oklab-palette.ts:112
Generates a palette of dominant colors from an array of OKLab pixels using K-means clustering and hierarchical clustering.
Parameters
Section titled “Parameters”pixels
Section titled “pixels”Oklab[]
An iterable of OKLab pixels to analyze.
options?
Section titled “options?”Optional parameters for palette generation.
Returns
Section titled “Returns”An array of OklabPaletteColor objects representing the dominant colors and their weights.