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.
This commit is contained in:
Chris Arcand 2021-04-21 21:27:19 -05:00
parent 58cba1dea3
commit 4b97411890
1 changed files with 7 additions and 1 deletions

View File

@ -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,
}