Skip to content

lchHueCluster

lchHueCluster(colors, hueThreshold): number[][]

Defined in: packages/math-color/src/models/lch-hue-cluster.ts:19

Clusters an array of chromatic Lab LCH colors by hue using agglomerative hierarchical clustering.

Only the hue angle (H in Lch) determines grouping — lightness and chroma are ignored. Achromatic colors have undefined hue and must be excluded before calling this function.

LchCoords[]

Chromatic Lab LCH colors to cluster.

number

Maximum hue angle distance in degrees to merge two clusters.

number[][]

Array of groups; each group is an array of indices into colors.