theme

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package theme loads cliamp-compatible color themes.

Index

Constants

View Source
const (
	// DefaultName is the display name of the terminal-palette theme.
	DefaultName = "Default - Terminal colors"
	// DefaultConfigName is the canonical configuration value for the terminal-palette theme.
	DefaultConfigName = "default"
	// LegacyDefaultConfigName is the former configuration value accepted as an alias for default.
	LegacyDefaultConfigName = "default-dark"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	Themes   []Theme
	Warnings []error
}

Registry is a sorted collection of selectable hex themes and non-fatal load warnings. The synthetic terminal default is resolved by Resolve and is not included in Themes.

func LoadAll

func LoadAll(userDir string) Registry

LoadAll loads embedded themes and valid user .toml files from userDir. User themes override built-ins with the same case-insensitive filename.

func (Registry) Resolve

func (r Registry) Resolve(name string) (Theme, bool)

Resolve returns the terminal default for an empty value, default, or default-dark, otherwise it matches a registry name case-insensitively.

type Theme

type Theme struct {
	Name     string
	Accent   string
	BrightFG string
	FG       string
	Green    string
	Yellow   string
	Red      string
}

Theme is a named cliamp-compatible six-color palette.

func Default

func Default() Theme

Default returns the explicit ANSI terminal-palette theme.

func Parse

func Parse(name string, r io.Reader) (Theme, error)

Parse reads and validates the six flat keys in a cliamp theme file. Blank lines, full-line comments, unknown keys, and lines without an equals sign are ignored for compatibility with cliamp.

func (Theme) IsDefault

func (t Theme) IsDefault() bool

IsDefault reports whether t is the terminal-palette theme.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL