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

Migrate to modern stack, including TS, new linting, updated APIs #255

Open janishutz opened 5 months ago

janishutz commented 5 months ago

What's new

Why

I have used this project before, but only browser based, where the current stack was good enough, but now that I am using this project for a web-app with a bundler, where I like to use NPM packages, it simply wasn't enough any more.

janishutz commented 5 months ago

Alright, I have finished this. I haven't bothered implementing tests for the new APIs, as they are the same as the old ones, but simply using modern browser APIs.

janishutz commented 5 months ago

@lokesh Sorry for the large PR. It's a lot of changes in the package-lock.json and the built files

janishutz commented 5 months ago

I would also like to suggest adding the wiki feature of GitHub. You can let me know when it is up, I can edit the Wiki for you and create docs. Alternatively, I could write some docs as a website

janishutz commented 3 months ago

I might just publish my own version of this to npm, so both versions exist

janishutz commented 3 months ago

I did publish my own package. npm i @janishutz/color-thief

challet commented 2 months ago

I did publish my own package. npm i @janishutz/color-thief

Your package is actually @janishutz/colorthief ;)

janishutz commented 2 months ago

Ohh right... thanks for pointing this out!