From bcf4abb26c4aa37cd07b5b052faba48e69d99812 Mon Sep 17 00:00:00 2001 From: mahdi Date: Sun, 5 Nov 2023 14:01:24 +0100 Subject: [PATCH] style - reset style on apply --- style/style.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/style/style.go b/style/style.go index 5ee9815..2a4a303 100644 --- a/style/style.go +++ b/style/style.go @@ -12,6 +12,7 @@ import ( const KEY_STYLE_NAME = 0 const KEY_STYLE_COLOR = 1 const KEY_STYLE_OPTION = 2 +const COLOR_OFF = "\\033[m" var defStyle *Style = &Style{color: color.HEXStyle("#ffffff"), Name: "default"} @@ -29,11 +30,11 @@ type Styles struct { } func (s *Style) Echof(format string, a ...any) { - s.color.Printf(format, a...) + s.color.Printf(format+COLOR_OFF, a...) } func (s *Style) Applyf(format string, a ...any) string { - return s.color.Sprintf(format, a...) + return s.color.Sprintf(format+COLOR_OFF, a...) } func (s *Style) Echo(data string) {