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

getPalette() return type is different from API document #190

Open rikapo opened 4 years ago

rikapo commented 4 years ago

Hello,

According to the API document, getPalette() function is supposed to return an array containing colors, but in fact, also returns null. (src/color-thief-node.js line 87)

It would be great if getPallete() uses reject() or returns an empty array instead of returning null. or API document informs about the possibility of returning null.

Best regards.