lokesh / color-thief

Grab the color palette from an image using just Javascript. Works in the browser and in Node.
https://lokeshdhakar.com/projects/color-thief/
MIT License
12.67k stars 1.31k forks source link

Quality will always be reset to 10 (fix included) #180

Closed cloutsocks closed 4 years ago

cloutsocks commented 5 years ago

https://github.com/lokesh/color-thief/blob/1c70277219c7bcfcd5ea4481cdb17136077c4fc1/src/core.js#L34

I believe you meant to check !Number.isInteger(quality), not the inverse. Also, I feel hard-coding the upper limit of 20 shouldn't be a thing, and that it should be a default option.