mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Implement loading a palette from the menu.
This commit is contained in:
committed by
Théo Cavignac
parent
c08c7f2d0b
commit
a36281935b
@@ -388,10 +388,12 @@ const ColorModule = (() => {
|
||||
*
|
||||
* @param {*} paletteColors The colours of the palette
|
||||
*/
|
||||
function createColorPalette(paletteColors) {
|
||||
function createColorPalette(paletteColors, clearCurrent=true) {
|
||||
//remove current palette
|
||||
while (colorsMenu.childElementCount > 1)
|
||||
colorsMenu.children[0].remove();
|
||||
if (clearCurrent) {
|
||||
while (colorsMenu.childElementCount > 1)
|
||||
colorsMenu.children[0].remove();
|
||||
}
|
||||
|
||||
var lightestColor = new Color("hex", '#000000');
|
||||
var darkestColor = new Color("hex", '#ffffff');
|
||||
@@ -527,4 +529,4 @@ const ColorModule = (() => {
|
||||
updateCurrentColor,
|
||||
getSelectedColor,
|
||||
}
|
||||
})();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user