mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-17 04:45:33 -08:00
Offer 38 highlight colors and keep a retired color's saved choice
AI Assisted
This commit is contained in:
1 parent
c602dfed57
commit
e67aaabdce
5 files changed
+126
-70
No files matched your search
@@ -4,7 +4,7 @@
|
||||
// `looks` is a live binding: every file reads the current object, and only
|
||||
// this file replaces it.
|
||||
|
||||
import { DEFAULT_ACCENT, soundPrefs, DEFAULT_CARD_WIDTH, ACCENTS, cardWidth, soundKey } from "./palette.js";
|
||||
import { DEFAULT_ACCENT, soundPrefs, DEFAULT_CARD_WIDTH, ACCENTS, accentId, cardWidth, soundKey } from "./palette.js";
|
||||
import { normalizeRole, ROLE_NOT_SET } from "./starters.js";
|
||||
import { bootData, hooks } from "./state.js";
|
||||
import { el } from "./render.js";
|
||||
@@ -40,7 +40,7 @@ export let looksReady = false;
|
||||
|
||||
export function adoptLooks(saved) {
|
||||
looks = { ...DEFAULT_LOOKS, ...saved };
|
||||
if (!ACCENTS[looks.accent]) looks.accent = DEFAULT_LOOKS.accent;
|
||||
looks.accent = accentId(looks.accent);
|
||||
if (!["system", "light", "dark"].includes(looks.theme)) looks.theme = DEFAULT_LOOKS.theme;
|
||||
if (typeof looks.sound !== "boolean") looks.sound = DEFAULT_LOOKS.sound;
|
||||
Object.assign(looks, soundPrefs(looks));
|
||||
|
||||
Reference in new issue
Block a user