We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm creating my own function which internally uses the GetPalette function. When using it in development mode, I can make it work simply by:
import Colorthief from "colorthief"; function getPaletteFromImage(img: HTMLImageElement, colorsCount: number, quality: number): string[] { const colorthief = new Colorthief(); var palette = colorthief.getPalette(img, colorsCount, quality); // ... }
However, this fails when running tests stating the Colorthief is not defined .
I noticed that you export the ColorThief function as a default in https://github.com/lokesh/color-thief/blob/master/src/color-thief.js#L147. You then use it by creating an object in https://github.com/lokesh/color-thief/blob/master/examples/js/demo.js#L1.
But in your tests, you don't create any object, and simply use a function. https://github.com/lokesh/color-thief/blob/master/test/node-test.js#L17
Why is that?
Thank you, Tiago
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm creating my own function which internally uses the GetPalette function.
When using it in development mode, I can make it work simply by:
However, this fails when running tests stating the Colorthief is not defined .
I noticed that you export the ColorThief function as a default in https://github.com/lokesh/color-thief/blob/master/src/color-thief.js#L147.
You then use it by creating an object in https://github.com/lokesh/color-thief/blob/master/examples/js/demo.js#L1.
But in your tests, you don't create any object, and simply use a function. https://github.com/lokesh/color-thief/blob/master/test/node-test.js#L17
Why is that?
Thank you,
Tiago
The text was updated successfully, but these errors were encountered: