use the original dims for the color extractor
This commit is contained in:
parent
7b8dafc852
commit
b1d8500611
1 changed files with 4 additions and 2 deletions
|
@ -30,10 +30,12 @@ const svgChangeTheme = (mode) => {
|
|||
*/
|
||||
const extractColors = (image) => {
|
||||
const canvas = document.createElement("canvas");
|
||||
canvas.width = image.width;
|
||||
canvas.height = image.height;
|
||||
canvas.width = image.naturalWidth;
|
||||
canvas.height = image.naturalHeight;
|
||||
const ctx = canvas.getContext("2d");
|
||||
ctx.drawImage(image, 0, 0);
|
||||
console.log(image);
|
||||
|
||||
const imageData = ctx.getImageData(
|
||||
0,
|
||||
0,
|
||||
|
|
Loading…
Reference in a new issue