Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
MSghais committed Aug 27, 2024
1 parent 8b1fdfd commit bce7d3a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/pixel_ui/src/canvas/TemplateCreationOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ const TemplateCreationOverlay = (props) => {
const imageData = ctx.getImageData(0, 0, image.width, image.height);
const data = imageData.data;
let imagePalleteIds = [];
let imagePaletteIds = [];
// Convert image data to color palette
for (let i = 0; i < data.length; i += 4) {
if (data[i + 3] < 128) {
data[i] = 255;
data[i + 1] = 255;
data[i + 2] = 255;
data[i + 3] = 0;
imagePalleteIds.push(255);
imagePaletteIds.push(255);
continue;
}
let minDistance = 1000000;
Expand All @@ -130,7 +130,7 @@ const TemplateCreationOverlay = (props) => {
data[i] = minColor[0];
data[i + 1] = minColor[1];
data[i + 2] = minColor[2];
imagePalleteIds.push(minColorIndex);
imagePaletteIds.push(minColorIndex);
}
// Set image data back to canvas
Expand Down

0 comments on commit bce7d3a

Please sign in to comment.