summaryrefslogtreecommitdiff
path: root/internal/color
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-09-06 14:07:07 +0300
committerPaul Buetow <paul@buetow.org>2021-09-06 14:07:07 +0300
commit6ae75e8f106d3eee18ea61e6c4d6925c6f514460 (patch)
tree1b2f0131a4fb0f4e8870460e5e85790ebe2a59a5 /internal/color
parentcc89d3fb8be2465af276d7ef03ea2a8affd87b2e (diff)
fine tweak color schema
Diffstat (limited to 'internal/color')
-rw-r--r--internal/color/brush/brush.go14
-rw-r--r--internal/color/paint.go5
2 files changed, 5 insertions, 14 deletions
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.