Color Thief does not detect right color

400 Views Asked by At

I have this sample code that detects color using color-thief

https://jsfiddle.net/spidercode/k6Lumq8y/1/

when I run this, it detects the color which is different in the shade. The color which I am expecting ( RGB(0, 150, 209) ) is not being detected by color-thief. My code to detect color is as follow:

img.addEventListener('load', function() {
 const colorThief = new ColorThief();
 var detectedColors = colorThief.getPalette(img);
    console.log(detectedColors);
});

enter image description here

0

There are 0 best solutions below