theme

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package theme carries the Catppuccin palettes a terminal UI draws from, the terminal-background detection that picks between them, and a semantic view naming the eight roles most views actually reach for.

Index

Constants

View Source
const EnvOverride = "CATPPUCCIN_THEME"

EnvOverride names the variable that pins a flavor regardless of what the terminal reports.

Variables

This section is empty.

Functions

This section is empty.

Types

type Palette

type Palette struct {
	Base     color.Color
	Mantle   color.Color
	Crust    color.Color
	Surface0 color.Color
	Surface1 color.Color
	Surface2 color.Color
	Overlay0 color.Color
	Overlay1 color.Color
	Overlay2 color.Color
	Subtext0 color.Color
	Subtext1 color.Color
	Text     color.Color

	Rosewater color.Color
	Flamingo  color.Color
	Pink      color.Color
	Mauve     color.Color
	Red       color.Color
	Maroon    color.Color
	Peach     color.Color
	Yellow    color.Color
	Green     color.Color
	Teal      color.Color
	Sky       color.Color
	Sapphire  color.Color
	Blue      color.Color
	Lavender  color.Color
}

Palette is one Catppuccin flavor. Fields are grouped as the upstream spec groups them: monochromatic ramp first, then the accents.

func Detect

func Detect() Palette

Detect picks a palette from the CATPPUCCIN_THEME override, falling back to the terminal's background color. Anything it cannot query reads as dark, so a piped or captured run is deterministic.

func Latte

func Latte() Palette

Latte returns the Catppuccin Latte (light) palette.

func Macchiato

func Macchiato() Palette

Macchiato returns the Catppuccin Macchiato (medium-dark) palette.

func Select

func Select(override string, dark func() bool) Palette

Select resolves an override string against a background probe, which is only called when the override does not name a flavor.

func (Palette) Semantic

func (p Palette) Semantic() Semantic

Semantic maps the palette onto the eight roles.

type Semantic

type Semantic struct {
	Primary   color.Color
	Secondary color.Color
	Accent    color.Color
	Muted     color.Color
	Text      color.Color
	Success   color.Color
	Warning   color.Color
	Error     color.Color
}

Semantic names the roles a view asks for when it does not care which flavor is active: a title is Primary whether the terminal is light or dark.

Jump to

Keyboard shortcuts

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