mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Removed test code updating palette
This commit is contained in:
parent
b8d1f11f93
commit
2e8f3f414b
@ -410,30 +410,6 @@ const ColorModule = (() => {
|
||||
|
||||
addColor(layersPaletteArray[i]);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
// Compare the current layer colors to the current palette and add any layer colors that aren't in the palette.
|
||||
let mergedPalette = [...currentPalette];
|
||||
|
||||
for (let i = 0; i < layersPaletteArray.length; i++) {
|
||||
let isNewPaletteColor = true;
|
||||
|
||||
for (let j = 0; j < currentPalette.length; j++) {
|
||||
// If the layer color matches an existing palette color skip it so it isn't added again.
|
||||
if (layersPaletteArray[i] === mergedPalette[j]) {
|
||||
isNewPaletteColor = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isNewPaletteColor) {
|
||||
mergedPalette.push(layersPaletteArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Recreate the palette using the merged colors array.
|
||||
createColorPalette(mergedPalette);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user