Documentation
¶
Overview ¶
Package theme defines memcode's color themes: a registry of named palettes (semantic color roles for TUI styles, diff RGBs, and chroma syntax-highlight style names) plus the active-theme accessor used by the renderer. Themes are registered at init time in themes.go; "aurora" is the default. A "random" meta-theme re-resolves to a different concrete theme on each launch.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chosen ¶
func Chosen() string
Chosen returns the literal theme name last passed to Set — e.g. "random" — so the front-end persists the user's choice rather than the concrete theme it resolved to.
func ChromaStyle ¶
ChromaStyle resolves the active theme's ChromaName to a *chroma.Style, caching the result so repeated calls are cheap (map lookup + RLock).
Types ¶
type DiffColors ¶
type DiffColors struct {
AddBg [3]int // RGB for added-line background
DelBg [3]int // RGB for deleted-line background
AddGutter [3]int // RGB for added-line gutter foreground
DelGutter [3]int // RGB for deleted-line gutter foreground
ContextGutter string // hex for context-line gutter foreground
}
DiffColors holds the RGB/ANSI values used for diff rendering backgrounds and gutters. These are raw numeric values (not hex strings) because diff.go builds ANSI escape sequences directly from the RGB components.
type Palette ¶
type Palette struct {
Brand string // primary brand (purple in aurora)
Info string // primary info (blue)
Secondary string // secondary info (cyan)
Success string // positive/success (green)
Warning string // caution (amber)
WarningAlt string // caution variant — darker amber
Danger string // error/forbidden (red)
DangerStrong string // error emphasis — lighter red
Accent string // accent highlight (magenta)
Emphasis string // high-emphasis text (near-white)
Muted string // secondary text (gray)
Dim string // gutter/divider (dark gray)
ToolGlyph string // tool glyph color — hex or "" for terminal default
}
Palette holds the 13 semantic color roles used by the TUI's lipgloss styles. Each field is a hex color string (e.g. "#A78BFA") except ToolGlyph, which may be empty to indicate "use the terminal default".
type Theme ¶
type Theme struct {
Name string // stable slug — the persisted key (e.g. "tokyonight")
Palette Palette
Diff DiffColors
ChromaName string // chroma style name — must resolve via styles.Get
}
Theme is a complete color theme: a name, palette (TUI styles), diff colors, and a chroma style name for syntax highlighting.