Open RichardRobertson opened 3 years ago
In chroma.average(...) the first color's hue gets weight applied twice. On line 23, xyz[i] is always mutated with the weight before it's checked to see if the current component === 'h'. This means that the cos and sin functions are getting the wrong angle. https://github.com/gka/chroma.js/blob/cb0f8c94c659bc4918b644eb306bf0bfa89c31b1/src/generator/average.js#L21-L30
xyz[i]
In chroma.average(...) the first color's hue gets weight applied twice. On line 23,
xyz[i]
is always mutated with the weight before it's checked to see if the current component === 'h'. This means that the cos and sin functions are getting the wrong angle. https://github.com/gka/chroma.js/blob/cb0f8c94c659bc4918b644eb306bf0bfa89c31b1/src/generator/average.js#L21-L30