I'm trying to use ColorThief in the node.js environment. When invoking ColorThief.getColor() I get the follwing error:
TypeError: url.indexOf is not a function
The error results from this line of code in the module.
if(url.indexOf('data:image/gif;')
Here my code:
const ColorThief = require('colorthief');
const img = document.querySelector('#image');
ColorThief.getColor(img)
.then(color => { console.log(color) })
.catch(err => { console.log(err) })
Any help solving this issue is appreciated.
From the https://lokeshdhakar.com/projects/color-thief documentation