diff --git a/pkg/iostreams/color.go b/pkg/iostreams/color.go index 33df6bddf..c8d48168f 100644 --- a/pkg/iostreams/color.go +++ b/pkg/iostreams/color.go @@ -252,5 +252,5 @@ func (c *ColorScheme) HexToRGB(hex string, x string) string { r, _ := strconv.ParseInt(hex[0:2], 16, 64) g, _ := strconv.ParseInt(hex[2:4], 16, 64) b, _ := strconv.ParseInt(hex[4:6], 16, 64) - return fmt.Sprintf("\033[38;2;%d;%d;%dm%s\033[39m", r, g, b, x) + return fmt.Sprintf("\033[38;2;%d;%d;%dm%s\033[0m", r, g, b, x) } diff --git a/pkg/iostreams/color_test.go b/pkg/iostreams/color_test.go index f3370da29..59fea53ed 100644 --- a/pkg/iostreams/color_test.go +++ b/pkg/iostreams/color_test.go @@ -18,7 +18,7 @@ func TestColorFromRGB(t *testing.T) { name: "truecolor", hex: "fc0303", text: "red", - wants: "\033[38;2;252;3;3mred\033[39m", + wants: "\033[38;2;252;3;3mred\033[0m", cs: NewColorScheme(true, true, true), }, { @@ -62,7 +62,7 @@ func TestHexToRGB(t *testing.T) { name: "truecolor", hex: "fc0303", text: "red", - wants: "\033[38;2;252;3;3mred\033[39m", + wants: "\033[38;2;252;3;3mred\033[0m", cs: NewColorScheme(true, true, true), }, {