diff options
| author | Paul Buetow <paul@buetow.org> | 2021-09-06 14:07:07 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-09-06 14:07:07 +0300 |
| commit | 6ae75e8f106d3eee18ea61e6c4d6925c6f514460 (patch) | |
| tree | 1b2f0131a4fb0f4e8870460e5e85790ebe2a59a5 /internal | |
| parent | cc89d3fb8be2465af276d7ef03ea2a8affd87b2e (diff) | |
fine tweak color schema
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/clients/stats.go | 6 | ||||
| -rw-r--r-- | internal/color/brush/brush.go | 14 | ||||
| -rw-r--r-- | internal/color/paint.go | 5 | ||||
| -rw-r--r-- | internal/config/client.go | 4 |
4 files changed, 10 insertions, 19 deletions
diff --git a/internal/clients/stats.go b/internal/clients/stats.go index 3f76e0f..faeb9fb 100644 --- a/internal/clients/stats.go +++ b/internal/clients/stats.go @@ -80,9 +80,9 @@ func (s *stats) printStatsDueInterrupt(messages []string) { for i, message := range messages { if i > 0 && config.Client.TermColorsEnable { fmt.Println(color.PaintStrWithAttr(message, - config.Client.TermColors.Client.TextFg, - config.Client.TermColors.Client.TextBg, - config.Client.TermColors.Client.TextAttr, + config.Client.TermColors.Client.ClientFg, + config.Client.TermColors.Client.ClientBg, + config.Client.TermColors.Client.ClientAttr, )) continue } diff --git a/internal/color/brush/brush.go b/internal/color/brush/brush.go index 785a0d0..524829b 100644 --- a/internal/color/brush/brush.go +++ b/internal/color/brush/brush.go @@ -183,19 +183,6 @@ func Colorfy(line string) string { case strings.HasPrefix(line, "SERVER"): paintServer(&sb, line) - /* - case strings.Contains(line, "ERROR"): - color.PaintWithAttr(&sb, line, - config.Client.TermColors.ClientErrorFg, - config.Client.TermColors.ClientErrorBg, - config.Client.TermColors.ClientErrorAttr) - - case strings.Contains(line, "WARN"): - color.PaintWithAttr(&sb, line, - config.Client.TermColors.ClientWarnFg, - config.Client.TermColors.ClientWarnBg, - config.Client.TermColors.ClientWarnAttr) - */ default: color.PaintWithAttr(&sb, line, color.FgDefault, @@ -203,6 +190,5 @@ func Colorfy(line string) string { color.AttrNone) } - color.ResetWithAttr(&sb) return sb.String() } diff --git a/internal/color/paint.go b/internal/color/paint.go index 2798ff7..5430acd 100644 --- a/internal/color/paint.go +++ b/internal/color/paint.go @@ -38,6 +38,8 @@ func Paint(sb *strings.Builder, text string, fg FgColor, bg BgColor) { sb.WriteString(string(fg)) sb.WriteString(string(bg)) sb.WriteString(text) + sb.WriteString(string(BgDefault)) + sb.WriteString(string(FgDefault)) } // Reset background and foreground colors. @@ -56,6 +58,9 @@ func PaintWithAttr(sb *strings.Builder, text string, fg FgColor, bg BgColor, att sb.WriteString(string(bg)) sb.WriteString(string(attr)) sb.WriteString(text) + sb.WriteString(string(AttrReset)) + sb.WriteString(string(BgDefault)) + sb.WriteString(string(FgDefault)) } // ResetWithAttr resets background, foreground and attributes. diff --git a/internal/config/client.go b/internal/config/client.go index 8bde7a4..3c2f7de 100644 --- a/internal/config/client.go +++ b/internal/config/client.go @@ -99,7 +99,7 @@ func newDefaultClientConfig() *ClientConfig { RemoteFg: color.FgWhite, CountAttr: color.AttrDim, CountBg: color.BgBlue, - CountFg: color.FgGreen, + CountFg: color.FgWhite, HostnameAttr: color.AttrBold, HostnameBg: color.BgBlue, HostnameFg: color.FgWhite, @@ -108,7 +108,7 @@ func newDefaultClientConfig() *ClientConfig { IdFg: color.FgWhite, StatsOkAttr: color.AttrNone, StatsOkBg: color.BgGreen, - StatsOkFg: color.FgBlue, + StatsOkFg: color.FgBlack, StatsWarnAttr: color.AttrNone, StatsWarnBg: color.BgRed, StatsWarnFg: color.FgWhite, |
