Skip to content

labWeightedMean

labWeightedMean<S>(entries): InSpace<LabCoords, S>

Defined in: packages/math-color/src/models/lab-weighted-mean.ts:22

Computes the coverage-weighted mean of an array of Lab colors.

Each entry contributes its color proportionally to its weight. The result is the weighted centroid of the input colors in Lab space.

S extends string

LabWeighted<S>[]

Array of Lab colors with associated weights (e.g. coverage fractions).

InSpace<LabCoords, S>

The weighted mean Lab color. Returns NaN components if the total weight is zero.