State the phone itself owns, so it lives here rather than in services/ — there is no
server behind it and no table. Modeled on display.ts: exported constants, a
usePersisted store, derived views, and no DOM access.
What replaced what
wallpaper.ts used to derive theme colors by substring-matching Tailwind class
names — if (value.includes('emerald')), and so on for three more. That could only
ever answer for the four presets somebody had written a branch for, and it answered
wrongly for two of them: the ocean preset contains indigo-950 and matched the
blue branch by accident, and the sunset preset is
from-purple-900 via-pink-900 to-rose-950 and matched purple, silently discarding
the pink and the rose. Anything unmatched returned an empty string, so the tokens fell
back to the shipped dark values — over a light wallpaper, unreadable text.
The fix is not a longer list of branches. A theme is now generated from a seed color
by arithmetic (lib/m3.ts), so every seed works and none of them is a special case.
The phone's active color theme.
State the phone itself owns, so it lives here rather than in
services/— there is no server behind it and no table. Modeled ondisplay.ts: exported constants, ausePersistedstore, derived views, and no DOM access.What replaced what
wallpaper.tsused to derive theme colors by substring-matching Tailwind class names —if (value.includes('emerald')), and so on for three more. That could only ever answer for the four presets somebody had written a branch for, and it answered wrongly for two of them: the ocean preset containsindigo-950and matched thebluebranch by accident, and the sunset preset isfrom-purple-900 via-pink-900 to-rose-950and matchedpurple, silently discarding the pink and the rose. Anything unmatched returned an empty string, so the tokens fell back to the shipped dark values — over a light wallpaper, unreadable text.The fix is not a longer list of branches. A theme is now generated from a seed color by arithmetic (
lib/m3.ts), so every seed works and none of them is a special case.