From 52b2b0253c4d36b4e267d049afdd2c91125578aa Mon Sep 17 00:00:00 2001 From: Joshua Kellogg Date: Sun, 8 Sep 2024 16:41:10 -0600 Subject: [PATCH] feat: expose constants for ANSI colors 0-15 --- color.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/color.go b/color.go index 5dfb3cfe..84af6ad2 100644 --- a/color.go +++ b/color.go @@ -69,6 +69,26 @@ func (c Color) RGBA() (r, g, b, a uint32) { // colorB := lipgloss.Color("21") type ANSIColor uint +// ANSI color codes. +const ( + ANSIBlack ANSIColor = iota + ANSIRed + ANSIGreen + ANSIYellow + ANSIBlue + ANSIMagenta + ANSICyan + ANSIWhite + ANSIBrightBlack + ANSIBrightRed + ANSIBrightGreen + ANSIBrightYellow + ANSIBrightBlue + ANSIBrightMagenta + ANSIBrightCyan + ANSIBrightWhite +) + func (ac ANSIColor) color(r *Renderer) termenv.Color { return Color(strconv.FormatUint(uint64(ac), 10)).color(r) }