update palette on selection

This commit is contained in:
Max Bradbury 2020-11-06 12:47:26 +00:00
parent 4bd896f05a
commit 69a3b482be
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import init, {
output, output,
set_brightness, set_brightness,
set_dither, set_dither,
set_palette,
set_room_name, set_room_name,
} from './pkg/pixsy.js'; } from './pkg/pixsy.js';
@ -171,6 +172,11 @@ async function run() {
buttonImageProceed.addEventListener("click", handleImage); buttonImageProceed.addEventListener("click", handleImage);
buttonImageProceed.addEventListener("touchend", handleImage); buttonImageProceed.addEventListener("touchend", handleImage);
selectPalette.addEventListener("change", () => {
set_palette(selectPalette.value);
loadPreview();
});
checkboxDither.addEventListener("change", () => { checkboxDither.addEventListener("change", () => {
set_dither(checkboxDither.checked); set_dither(checkboxDither.checked);
loadPreview(); loadPreview();