Documentation
¶
Overview ¶
Package theme provides theme file parsing and serialization for revdiff color palettes. Theme files use INI format with comment-based metadata (# name: ..., # description: ...).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BundledNames ¶
func BundledNames() []string
BundledNames returns the sorted list of bundled theme names.
func ColorKeys ¶
func ColorKeys() []string
ColorKeys returns the ordered list of recognized color key names.
func Dump ¶
Dump writes a theme file to w from the given Theme. Colors are written in the canonical order defined by ColorKeys().
func InitBundled ¶
InitBundled writes bundled theme files to the given directory, creating it if needed. Always overwrites files matching bundled theme names; does not touch user-added files.
func List ¶
List returns sorted names of theme files in the given directory. Returns an empty list if the directory does not exist.
func OptionalColorKeys ¶ added in v0.12.0
OptionalColorKeys returns the set of color keys that may be omitted from theme files. these correspond to CLI flags with no default value (terminal background is used instead).
Types ¶
type Theme ¶
type Theme struct {
Name string
Description string
ChromaStyle string
Colors map[string]string // keys include the "color-" prefix, matching ini-name tags exactly (e.g. "color-accent")
}
Theme represents a color theme with metadata and color key-value pairs.