Documentation
¶
Overview ¶
Package theme loads the UI color scheme from a small YAML config file, the same way plugins and saved hosts are persisted next to the d9c binary. It ships a set of named palettes (Tokyo Night, Dracula, Nord, …) and lets the user pick one and/or override individual base colors, then hands the result to the styles package via styles.Apply.
Example d9c-config.yaml:
theme: dracula # built-in palette name (optional; default tokyonight) colors: # optional per-color overrides (hex #rrggbb or ANSI 0-255) primary: "#ff79c6" danger: "#ff5555"
Index ¶
Constants ¶
const DefaultName = "tokyonight"
DefaultName is the built-in palette used when the config file is absent or does not name a theme.
Variables ¶
This section is empty.
Functions ¶
func ByName ¶
ByName returns the built-in palette with the given name (case-insensitive), reporting whether it exists. It is the entry point for switching themes at runtime without a config file.
func DefaultPath ¶
func DefaultPath() string
DefaultPath returns the config file location next to the running binary, falling back to the current directory if the executable path is unavailable.
func Load ¶
Load reads the config file at path and resolves it to a palette: the named built-in theme (default tokyonight) with any per-color overrides applied. A missing file yields the default palette (not an error); malformed YAML, an unknown theme name, an unknown color key, or an invalid color value is an error.
func NameOf ¶
NameOf returns the built-in theme name whose palette equals p, or "" if p does not match any built-in (e.g. a config with custom color overrides).