Skip to content

Commit

Permalink
fixes regression where color sprites had incorrect palettes in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Q-Bert-Reynolds committed Oct 5, 2024
1 parent 3237f33 commit ef1aaac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/sprites/preview/MetaspriteCanvas.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ workerCtx.onmessage = async (evt) => {
[0, 1, 2, 3, 4, 5, 6, 7].forEach((i) => {
tilesCanvases[i] = new OffscreenCanvas(img.width, img.height);
const colors = previewAsMono
? DMG_PALETTE.colors //TODO: replace with custom DMG colors from settings
? DMG_PALETTE.colors
: palettes[i] || DMG_PALETTE.colors;
const canvas = tilesCanvases[i];
const ctx = canvas.getContext("2d");
Expand All @@ -92,7 +92,7 @@ workerCtx.onmessage = async (evt) => {
tileImageData.width,
tileImageData.height
);
colorizeSpriteData(imageDataCopy.data, [0,1,2,3], colors);
colorizeSpriteData(imageDataCopy.data, [0,0,1,3], colors);
ctx.putImageData(imageDataCopy, 0, 0);
});
}
Expand Down

0 comments on commit ef1aaac

Please sign in to comment.