From dc47c08f2877b95dbb41bbfa789726de51d334dc Mon Sep 17 00:00:00 2001 From: mvllow Date: Wed, 19 Nov 2025 13:29:53 -0600 Subject: [PATCH] feat: add normal and bright terminal aliases --- color/palette.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/color/palette.go b/color/palette.go index b44b9f3..18cf82d 100644 --- a/color/palette.go +++ b/color/palette.go @@ -42,6 +42,25 @@ var Accents = []string{ "love", "gold", "rose", "pine", "foam", "iris", } +var colorAliases = map[string]string{ + "black": "overlay", + "brightBlack": "muted", + "red": "love", + "brightRed": "love", + "green": "pine", + "brightGreen": "pine", + "yellow": "gold", + "brightYellow": "gold", + "blue": "foam", + "brightBlue": "foam", + "magenta": "iris", + "brightMagenta": "iris", + "cyan": "rose", + "brightCyan": "rose", + "white": "text", + "brightWhite": "text", +} + var ( MainPalette = Palette{ Base: Color{ @@ -286,6 +305,10 @@ var Variants = []VariantMeta{ } func (p *Palette) Get(role string) (*Color, bool) { + if aliasTarget, isAlias := colorAliases[role]; isAlias { + return p.Get(aliasTarget) + } + switch role { case "base": return &p.Base, true @@ -369,5 +392,14 @@ func (p *Palette) Iter() iter.Seq2[string, *Color] { if !yield("highlightHigh", &p.HighlightHigh) { return } + + // Add aliases + for alias, target := range colorAliases { + if color, ok := p.Get(target); ok { + if !yield(alias, color) { + return + } + } + } } }