From 4b97411890909e9b3ad9f72ac2c4ddd13ee1fcd5 Mon Sep 17 00:00:00 2001 From: Chris Arcand Date: Wed, 21 Apr 2021 21:27:19 -0500 Subject: [PATCH] Add purple to the list of colorstring codes This is the first color code introduced for 256 color terminals, and should be a safe addition when considering the oldest supported platform. --- command/meta.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/command/meta.go b/command/meta.go index 69f01ebd8..1cad1bffe 100644 --- a/command/meta.go +++ b/command/meta.go @@ -250,8 +250,14 @@ func (m *Meta) StateOutPath() string { // Colorize returns the colorization structure for a command. func (m *Meta) Colorize() *colorstring.Colorize { + colors := make(map[string]string) + for k, v := range colorstring.DefaultColors { + colors[k] = v + } + colors["purple"] = "38;5;57" + return &colorstring.Colorize{ - Colors: colorstring.DefaultColors, + Colors: colors, Disable: !m.color, Reset: true, }