Open LuccaGarcia opened 2 years ago
Same problem :(
Same problem here ✨
A try catch in the js file solved it for me (i pushed the hex code into my array aaaand problem solved)
try {
rgbColors = colorThief.getColor(element);
console.log(rgbColors);
console.log(rgbColors[0]);
console.log(rgbColors[1]);
console.log(rgbColors[2]);
let result = rgbToHex(rgbColors[0], rgbColors[1], rgbColors[2]);
console.log("Le résultat en hexa est : " + result); // #0033ff
colorsArray.push(result);
console.log(colorsArray);
} catch (error) {
console.log(error);
colorsArray.push("#ffffff");
}
Using ColorThief to return the dominant color of a white image raises an exception
Code:![image](https://user-images.githubusercontent.com/70383956/132075702-ceec3583-021a-44f0-a7d0-bc1d050dfeef.png)
Exception happens at line four:![image](https://user-images.githubusercontent.com/70383956/132075688-1e692109-3754-4fb5-bbf1-4d722ec613ff.png)
Image used:![white](https://user-images.githubusercontent.com/70383956/132075765-cd616cf9-0d66-4edf-981c-d37358584bcf.jpg)
Other colors do not seam to cause the same error