{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package theme\n\nPackage 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.\n\n## Functions\n\n```go\nfunc Chosen() string\n```\nChosen 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.\n\n```go\nfunc ChromaStyle() *chroma.Style\n```\nChromaStyle resolves the active theme's ChromaName to a \\*chroma.Style, caching the result so repeated calls are cheap (map lookup + RLock).\n\n```go\nfunc Names() []string\n```\nNames returns the sorted list of all registered theme names.\n\n```go\nfunc Register(t Theme)\n```\nRegister adds a theme to the registry. Call from an init() function.\n\n```go\nfunc Set(name string) bool\n```\nSet switches the active theme to the named theme. Returns true if the name was found and the theme was changed; returns false for unknown names (no mutation).\n\n## Types\n\n```go\ntype DiffColors struct {\n\tAddBg         [3]int // RGB for added-line background\n\tDelBg         [3]int // RGB for deleted-line background\n\tAddGutter     [3]int // RGB for added-line gutter foreground\n\tDelGutter     [3]int // RGB for deleted-line gutter foreground\n\tContextGutter string // hex for context-line gutter foreground\n}\n```\nDiffColors 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.\n\n```go\ntype Palette struct {\n\tBrand        string // primary brand (purple in aurora)\n\tInfo         string // primary info (blue)\n\tSecondary    string // secondary info (cyan)\n\tSuccess      string // positive/success (green)\n\tWarning      string // caution (amber)\n\tWarningAlt   string // caution variant — darker amber\n\tDanger       string // error/forbidden (red)\n\tDangerStrong string // error emphasis — lighter red\n\tAccent       string // accent highlight (magenta)\n\tEmphasis     string // high-emphasis text (near-white)\n\tMuted        string // secondary text (gray)\n\tDim          string // gutter/divider (dark gray)\n\tToolGlyph    string // tool glyph color — hex or \"\" for terminal default\n}\n```\nPalette 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\".\n\n```go\ntype Theme struct {\n\tName       string // stable slug — the persisted key (e.g. \"tokyonight\")\n\tPalette    Palette\n\tDiff       DiffColors\n\tChromaName string // chroma style name — must resolve via styles.Get\n}\n```\nTheme is a complete color theme: a name, palette (TUI styles), diff colors, and a chroma style name for syntax highlighting.\n\n```go\nfunc Active() Theme\n```\nActive returns the current theme.\n\n","path":"github.com/memcode-ai/memcode/internal/theme","name":"theme","synopsis":"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.","isRedistributable":true}
