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.
Parameters
Section titled “Parameters”colors
Section titled “colors”Chromatic Lab LCH colors to cluster.
hueThreshold
Section titled “hueThreshold”number
Maximum hue angle distance in degrees to merge two clusters.
Returns
Section titled “Returns”number[][]
Array of groups; each group is an array of indices into colors.