diff --git a/examples/web/index.ts b/examples/web/index.ts index 85367731500fbf7db2369265d1c74ac792d40e28..a1d02154bffacd6e9b0665c59729444ad6b4238c 100644 --- a/examples/web/index.ts +++ b/examples/web/index.ts @@ -34,8 +34,18 @@ const BACKGROUNDS = [ ]; const PALETTES = [ - ["ffffff", "c0c0c0", "606060", "000000"], - ["b6a571", "8b7e56", "554d35", "201d13"] + { + name: "basic", + colors: ["ffffff", "c0c0c0", "606060", "000000"] + }, + { + name: "hogwards", + colors: ["b6a571", "8b7e56", "554d35", "201d13"] + }, + { + name: "pacman", + colors: ["ffff00", "ffb897", "3732ff", "000000"] + } ]; const KEYS_NAME: Record<string, number> = { @@ -466,7 +476,8 @@ class GameboyEmulator extends EmulatorBase implements Emulator { } updatePalette() { - this.gameBoy?.set_palette_colors_ws(PALETTES[this.paletteIndex]); + const palette = PALETTES[this.paletteIndex]; + this.gameBoy?.set_palette_colors_ws(palette.colors); this.paletteIndex += 1; this.paletteIndex %= PALETTES.length; }