theme

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingSelection = errors.New("missing required ui.selection scope")
	ErrInvalidTheme     = errors.New("invalid theme")
)

Functions

This section is empty.

Types

type Theme

type Theme struct {
	// contains filtered or unexported fields
}

func Decode

func Decode(data map[string]any) (*Theme, []string)

Decode builds a theme from raw TOML, returning warnings for entries it could not parse rather than failing

func Default

func Default() (*Theme, error)

Default loads the theme used when none is configured

func Load

func Load(name string) (*Theme, error)

Load reads an embedded theme by name, resolving its inherits chain

func (*Theme) Dimmed added in v0.1.25

func (t *Theme) Dimmed(pct int) *Theme

Dimmed returns a copy of the theme with every style darkened by pct, for rendering unfocused panes

func (*Theme) Get

func (t *Theme) Get(scope string) tui.Style

Get resolves a scope, falling back to its dotted ancestors, and yields the zero style when nothing matches

func (*Theme) Is16Color

func (t *Theme) Is16Color() bool

Is16Color reports whether the theme names only palette colors, so it renders correctly without true color

func (*Theme) Name

func (t *Theme) Name() string

Name is the theme's identifier

func (*Theme) Quantized added in v0.1.35

func (t *Theme) Quantized() *Theme

Quantized returns a copy of the theme with every style snapped onto the 256-color palette, for terminals without true color

func (*Theme) RainbowLength

func (t *Theme) RainbowLength() int

RainbowLength is the number of rainbow bracket colors defined

func (*Theme) Scopes

func (t *Theme) Scopes() []string

Scopes lists every scope the theme defines

func (*Theme) TryGet

func (t *Theme) TryGet(scope string) (tui.Style, bool)

TryGet resolves a scope, falling back to its dotted ancestors

func (*Theme) TryGetExact

func (t *Theme) TryGetExact(scope string) (tui.Style, bool)

TryGetExact resolves a scope without ancestor fallback

func (*Theme) Validate

func (t *Theme) Validate() error

Validate reports whether the theme defines the scopes rendering needs

Jump to

Keyboard shortcuts

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