adds a new parameter weights to the chroma.average method. weights have to be an array of numbers of the same length as the colors array. weights are normalized automatically.
colors = ['#ddd', 'yellow', 'red', 'teal'];
chroma.average(colors, 'lch'); // unweighted
chroma.average(colors, 'lch', [1,1,2,1]); // more red
chroma.average(colors, 'lch', [1,0.5,1,2.3]); // less yellow, more teal
adds a new parameter
weights
to thechroma.average
method. weights have to be an array of numbers of the same length as the colors array. weights are normalized automatically.