labLightnessCluster
labLightnessCluster(
colors,lightnessThreshold):number[][]
Defined in: packages/math-color/src/models/lab-lightness-cluster.ts:16
Clusters an array of Lab colors by lightness using agglomerative hierarchical clustering.
Only the L component is used for grouping — hue and chroma are ignored. Intended for achromatic colors where hue is undefined.
Parameters
Section titled “Parameters”colors
Section titled “colors”Lab colors to cluster.
lightnessThreshold
Section titled “lightnessThreshold”number
Maximum lightness distance to merge two clusters.
Returns
Section titled “Returns”number[][]
Array of groups; each group is an array of indices into colors.