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 ¶
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 Macchiato ¶
func Macchiato() Palette
Macchiato returns the Catppuccin Macchiato (medium-dark) palette.
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.