aboutsummaryrefslogtreecommitdiff
path: root/ui/widget
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-04-18 17:33:59 +0300
committerTulir Asokan <tulir@maunium.net>2018-04-18 17:33:59 +0300
commit3b2d5fa0349bf01217f6954813c669680cdd16d4 (patch)
tree11e9c8a6e22bd37f5203a7f9debf8d609bbc1e7a /ui/widget
parent670d369c92bc3c450071c1a10ec5d034a53258ea (diff)
Fix nick coloring
Diffstat (limited to 'ui/widget')
-rw-r--r--ui/widget/color.go9
1 files changed, 5 insertions, 4 deletions
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)
}