summaryrefslogtreecommitdiffstats
path: root/src/tui/tui.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/tui/tui.go')
-rw-r--r--src/tui/tui.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tui/tui.go b/src/tui/tui.go
index 859eed7a..11ac1e7d 100644
--- a/src/tui/tui.go
+++ b/src/tui/tui.go
@@ -1,6 +1,7 @@
package tui
import (
+ "strconv"
"time"
)
@@ -121,6 +122,13 @@ type ColorPair struct {
id int16
}
+func HexToColor(rrggbb string) Color {
+ r, _ := strconv.ParseInt(rrggbb[1:3], 16, 0)
+ g, _ := strconv.ParseInt(rrggbb[3:5], 16, 0)
+ b, _ := strconv.ParseInt(rrggbb[5:7], 16, 0)
+ return Color((1 << 24) + (r << 16) + (g << 8) + b)
+}
+
func NewColorPair(fg Color, bg Color) ColorPair {
return ColorPair{fg, bg, -1}
}