clone

fifteen puzzle games for the terminal, with daily puzzles, weekly ladders and xp, built on bubble tea

chore/app-model-decomp
puzzletea / theme / default.go
default.go 3.5K
1package theme23import (4 "image/color"56 "charm.land/lipgloss/v2"7)89// DefaultThemeName is the name of the built-in earth-tone palette that ships10// with PuzzleTea. When no theme is configured, this palette is active.11const DefaultThemeName = "PuzzleTea Default"1213// defaultPalette returns the hand-tuned palette that ships with PuzzleTea.14// Base colors are chosen so that every critical FG/BG pairing meets WCAG AA15// after [enforcePaletteContrast] runs. The contrast enforcement step16// auto-selects cursor text color (light or dark) based on accent luminance.17func defaultPalette() Palette {18 bg := lipgloss.Color("#262626") // 235 — main background19 fg := lipgloss.Color("#d0d0d0") // 252 — primary text20 surface := lipgloss.Color("#3a3a3a") // 237 — subtle elevation2122 // FG-role tokens23 accent := lipgloss.Color("#cc8844") // 3 yellow — primary accent24 accentSoft := lipgloss.Color("#cc9966") // 11 brightYellow25 accentText := lipgloss.Color("#e4e4e4") // 7 white — text on AccentBG26 success := lipgloss.Color("#55aa55") // 2 green — success FG27 successBorder := lipgloss.Color("#99cc33") // 10 brightGreen28 solvedFG := lipgloss.Color("#eeeeee") // 15 brightWhite29 errorFG := lipgloss.Color("#cc3333") // 1 red — error FG30 info := lipgloss.Color("#bb8844") // 4 blue — info31 given := lipgloss.Color("#993399") // 5 purple — given32 linked := lipgloss.Color("#cc9933") // 6 cyan — linked33 highlight := lipgloss.Color("#99cccc") // 14 brightCyan — highlight FG34 secondary := lipgloss.Color("#cccc99") // 12 brightBlue — secondary35 tertiary := lipgloss.Color("#99cc99") // 13 brightPurple — tertiary3637 p := Palette{38 BG: bg,39 FG: fg,40 Surface: surface,4142 Accent: accent,43 AccentSoft: accentSoft,44 AccentText: accentText,45 TextDim: lipgloss.Color("#949494"), // ~246 — muted text46 Border: lipgloss.Color("#585858"), // ~240 — borders4748 Success: success,49 SuccessBorder: successBorder,50 SolvedFG: solvedFG,51 Error: errorFG,52 Info: info,53 Given: given,54 Linked: linked,55 Highlight: highlight,56 Secondary: secondary,57 Tertiary: tertiary,5859 // Derived BGs (blended toward BG/Surface)60 AccentBG: Blend(bg, accent, blendAccentBG),61 SuccessBG: Blend(bg, success, blendSuccessBG),62 ErrorBG: Blend(bg, errorFG, blendErrorBG),63 SelectionBG: Blend(surface, highlight, blendSelectionBG),64 HighlightBG: Blend(surface, linked, blendHighlightBG),6566 ANSI: [16]color.Color{67 lipgloss.Color("#262626"), // 0 black — border68 lipgloss.Color("#cc3333"), // 1 red — error69 lipgloss.Color("#55aa55"), // 2 green — success70 lipgloss.Color("#cc8844"), // 3 yellow — accent71 lipgloss.Color("#bb8844"), // 4 blue — info72 lipgloss.Color("#993399"), // 5 purple — given73 lipgloss.Color("#cc9933"), // 6 cyan — linked74 lipgloss.Color("#d0d0d0"), // 7 white — accentText75 lipgloss.Color("#949494"), // 8 brightBlack — surface76 lipgloss.Color("#cc6666"), // 9 brightRed — (unassigned)77 lipgloss.Color("#99cc33"), // 10 brightGreen — successBorder78 lipgloss.Color("#cc9966"), // 11 brightYellow — accentSoft79 lipgloss.Color("#cccc99"), // 12 brightBlue — secondary80 lipgloss.Color("#99cc99"), // 13 brightPurple — tertiary81 lipgloss.Color("#99cccc"), // 14 brightCyan — highlight82 lipgloss.Color("#eeeeee"), // 15 brightWhite — solvedFG83 },84 }85 return enforcePaletteContrast(p)86}