So, i'm trying to get my dominant color from color thief. But i'm constantly getting this error:
Here is my code that I took from the official documentation
var ColorThief = require('colorthief');
// if I don't include this I will get an error that resolve is not defined
const { resolve } = require('path');
const setMarker = ({ data }) => {
// this returns a string with the url to the logo
const logo = data.logo ? data.logo : LogoPlaceholder
const img = resolve(process.cwd(), logo);
ColorThief.getColor(img)
.then(color => { console.log(color) })
.catch(err => { console.log(err) })
}
Anyone has anidea how to get this working?
EDIT : Maybe a key thing to know is that I'm not letting the images load in my website, I only need the colours of them
