From d4a3c08b5c31ce7a71aef5dba0994eb78d74ba89 Mon Sep 17 00:00:00 2001 From: Simon Paul Date: Mon, 24 May 2021 21:19:03 +0200 Subject: [PATCH] Add helper function file --- tui/helper.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tui/helper.go diff --git a/tui/helper.go b/tui/helper.go new file mode 100644 index 0000000..d3e9ab5 --- /dev/null +++ b/tui/helper.go @@ -0,0 +1,12 @@ +package tui + +import ( + "fmt" + + "github.com/gdamore/tcell/v2" +) + +func hexStringFromColor(c tcell.Color) string { + r, g, b := c.RGB() + return fmt.Sprintf("[#%02x%02x%02x]", r, g, b) +}