Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
class_name BuiltinThemes
|
|
|
|
|
extends RefCounted
|
|
|
|
|
## The theme sets that ship with the app. Kept in code rather than JSON so they
|
|
|
|
|
## need no export filter. A set lists only what differs from Style's fallback
|
|
|
|
|
## values (the Felt look); ThemeStore fills in the rest.
|
|
|
|
|
##
|
|
|
|
|
## Set keys: id, name, colors {TOKEN: "#hex"}, background and panel fills
|
|
|
|
|
## ({kind: "solid"|"linear"|"radial", colors: [...], angle}), pattern
|
2026-11-10 18:20:46 -06:00
|
|
|
## ("none"|"dots"|"stars"), card_frame ("ornate"|"plain"), logo, font_body,
|
|
|
|
|
## font_display.
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
|
|
|
|
|
const TAROT := {
|
|
|
|
|
"id": "tarot", "name": "Tarot", "builtin": true,
|
2026-11-10 18:20:46 -06:00
|
|
|
"pattern": "stars", "logo": "fortune_teller", "card_frame": "ornate",
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
"font_body": "atkinson", "font_display": "rokkitt",
|
|
|
|
|
# A jewel-tone spread cloth with a soft shine up and to the left.
|
|
|
|
|
"background": {"kind": "radial", "colors": ["#4b1470", "#2c0744", "#1f0431"], "center": [0.32, 0.28]},
|
|
|
|
|
"panel": {"kind": "linear", "colors": ["#260539", "#16021f"], "angle": 90},
|
|
|
|
|
"colors": {
|
|
|
|
|
"BG": "#2c0744", "BG_DEEP": "#1c0329", "BG_HOVER": "#45106a", "PANEL": "#1c0329",
|
|
|
|
|
"ON_BG": "#f3e7f8", "ON_BG_MUTED": "#bba5cb",
|
|
|
|
|
"CARD": "#f4ead8", "CARD_SOFT": "#faf3e6", "CARD_HOVER": "#eadcc3", "CARD_SHADE": "#ddcdb0",
|
|
|
|
|
"INK": "#1c0329", "MUTED": "#6e5a7c", "FAINT": "#a08fae", "RULE": "#e2d2b8",
|
|
|
|
|
"DASH": "#c6b395", "HOVER_ROW": "#efe2cb", "STRIPE": "#5c0e7510",
|
|
|
|
|
"TRIM": "#823d08", "TRIM_DARK": "#4a2004",
|
|
|
|
|
"THREAD": "#c07a2c", "THREAD_DARK": "#5a2a06",
|
|
|
|
|
"ACCENT": "#f2b84b", "ACCENT_DARK": "#6b4a0c", "LIT": "#fbe3a6", "FLICK": "#f2b84b59",
|
|
|
|
|
"PULSE": "#fff3d6", "GLOW": "#2fe39a",
|
|
|
|
|
"OK_INK": "#04736e", "REF_INK": "#03635f", "REF_BG": "#d3eeea", "REF_INK_ON_BG": "#7fe8c9",
|
|
|
|
|
"VALUE_INK": "#7a3f06", "VALUE_INK_ON_BG": "#f2b84b", "VALUE_BG": "#fbf0d8", "VALUE_BORDER": "#e0b56a",
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
## The original green felt and copper look, kept as a second set.
|
|
|
|
|
const FELT := {
|
|
|
|
|
"id": "felt", "name": "Felt", "builtin": true,
|
2026-11-10 18:24:23 -06:00
|
|
|
"pattern": "dots", "logo": "tower", "card_frame": "plain",
|
Theme system: runtime colour tokens, theme sets and a Theme dialog
Style's colours become static vars named by role (BG, PANEL, CARD, THREAD,
ACCENT, TRIM, GLOW…) instead of materials (felt, copper, brass), so a theme
can replace them. Stray hard-coded colours moved into tokens.
ThemeStore applies built-in sets (Tarot, the new default: jewel-purple
cloth with a shine; Felt, the old look) and the user's own sets from
user://themes/. Fills for the background and panels can be gradients; the
background pattern (dots, stars, none) and logo are per set. View ▾ →
Theme… edits a set; changes to a built-in save as a new set. Using a theme
reloads the UI and keeps the open spread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 18:10:16 -06:00
|
|
|
"font_body": "atkinson", "font_display": "rokkitt",
|
|
|
|
|
"background": {"kind": "radial", "colors": ["#2a5c47", "#1f4a39"], "center": [0.35, 0.3]},
|
|
|
|
|
"panel": {"kind": "solid", "colors": ["#12301f"]},
|
|
|
|
|
"colors": {},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static func all() -> Array[Dictionary]:
|
|
|
|
|
return [TAROT, FELT]
|