From 3b2d5fa0349bf01217f6954813c669680cdd16d4 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 18 Apr 2018 17:33:59 +0300 Subject: Fix nick coloring --- ui/widget/color.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ui/widget') diff --git a/ui/widget/color.go b/ui/widget/color.go index c4f1abf..c46377a 100644 --- a/ui/widget/color.go +++ b/ui/widget/color.go @@ -21,6 +21,7 @@ import ( "hash/fnv" "sort" + "maunium.net/go/gomuks/debug" "maunium.net/go/tcell" ) @@ -51,6 +52,7 @@ func init() { // <-- = red // --- = yellow func GetHashColorName(s string) string { + debug.Print("Getting color for", s) switch s { case "-->": return "green" @@ -72,8 +74,7 @@ func GetHashColor(s string) tcell.Color { return tcell.ColorNames[GetHashColorName(s)] } -// AddHashColor adds tview color tags to the given string. -// The color added is the color returned by GetHashColorName(). -func AddHashColor(s string) string { - return fmt.Sprintf("[%s]%s[white]", GetHashColorName(s), s) +// AddColor adds tview color tags to the given string. +func AddColor(s, color string) string { + return fmt.Sprintf("[%s]%s[white]", color, s) } -- cgit v1.2.3