Files
slate32/sdcard/lib/theme.lua
T
evan 0a27062a70 feat(ui): themes derived from three seed colors
Every app re-declared the same black/white/accent triple, so a palette now lives in
/lib/theme.lua and ui.lua derives muted, contrast, gradients and radius from it.
Deriving rather than listing means a new component costs no theme keys, and a theme
cannot pick text that is unreadable on its own accent.

Components take the palette by inheritance, so the three apps name no colors at all;
ui.theme stays for drawing outside the tree. Settings cycles the installed themes and
stores only the name.
2026-08-01 10:04:52 -04:00

13 lines
589 B
Lua

-- Canned themes. A theme is three 8-bit RGB seeds; ui.lua derives the rest, so
-- adding a component never means editing this file. Add an entry to add a theme.
--
-- Any derived role can be pinned here: muted and accent_fg take one {r,g,b},
-- face and face_pressed take two (top and bottom of the button gradient), and
-- radius takes pixels.
return {
light = {bg = {255, 255, 255}, fg = {0, 0, 0}, accent = {0, 120, 255}},
dark = {bg = {18, 18, 20}, fg = {235, 235, 235}, accent = {0, 140, 255}},
mono = {bg = {255, 255, 255}, fg = {0, 0, 0}, accent = {0, 0, 0}, radius = 0},
}