Skip to content

Commit

Permalink
fix(iostreams): If enabled, proxy the color to ansi.ColorFunc
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <alex@unikraft.io>
  • Loading branch information
nderjung committed Apr 26, 2024
1 parent eaa3781 commit d2e61f6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iostreams/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,12 @@ func (c *ColorScheme) ColorFromString(s string) func(string) string {
case "blue":
fn = c.Blue
default:
fn = func(s string) string {
return s
if c.enabled {
fn = ansi.ColorFunc(s)
} else {
fn = func(s string) string {
return s
}
}
}

Expand Down

0 comments on commit d2e61f6

Please sign in to comment.