theme

package
v1.62.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package theme handles loading and parsing color themes from TOML files.

Index

Constants

View Source
const DefaultName = "Default - Terminal colors"

DefaultName is the display name for the built-in ANSI fallback theme.

Variables

This section is empty.

Functions

This section is empty.

Types

type Theme

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

Theme holds a named color scheme with hex color values.

func Default

func Default() Theme

Default returns a sentinel "Default" theme with empty hex values, signaling that ANSI fallback colors should be used.

func LoadAll

func LoadAll() []Theme

LoadAll loads built-in themes and user custom themes from ~/.config/cliamp/themes/*.toml. User themes override built-in themes with the same name. Returns a sorted list.

func Parse

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

Parse reads flat TOML key=value lines from r and returns a Theme. Uses the same manual parsing approach as config/config.go.

func (Theme) IsDefault

func (t Theme) IsDefault() bool

IsDefault returns true if this is the sentinel default theme (no hex values).

func (Theme) Validate added in v1.61.0

func (t Theme) Validate() error

Validate ensures a custom theme supplies the complete six-color palette in CSS hex notation. The terminal-default sentinel intentionally has no colors.

Jump to

Keyboard shortcuts

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