From b6eefeb0c8a002cc38c88d5d97c653ac9fd35889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=9E=E3=83=AA=E3=82=A6=E3=82=B9?= Date: Sat, 17 Oct 2020 01:32:18 +0100 Subject: [PATCH] Implemented GetColorFnFromHex --- z/tui.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/z/tui.go b/z/tui.go index 8d0c533..0b9dfdd 100644 --- a/z/tui.go +++ b/z/tui.go @@ -108,3 +108,10 @@ func OutputAppendRight(leftStr string, rightStr string, pad int) (string) { return output } + +func GetColorFnFromHex(colorHex string) (func(...interface {}) string) { + if colorHex == "" { + colorHex = "#dddddd" + } + return color.NewRGBStyle(color.HEX(colorHex)).Sprint +}