From b8b3c9dc8345ee21d4c843f8b893811b079a2740 Mon Sep 17 00:00:00 2001 From: Gavin Date: Mon, 16 Dec 2019 00:38:33 -0500 Subject: [PATCH] Add ability to set theme colors by hex code --- internal/config/style.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/config/style.go b/internal/config/style.go index 8f5175b1..c9e5ebf8 100644 --- a/internal/config/style.go +++ b/internal/config/style.go @@ -329,7 +329,10 @@ func (s *Styles) Update() { func AsColor(c string) tcell.Color { if color, ok := tcell.ColorNames[c]; ok { return color + } else { + // Use tcell.GetColor to support hex codes. + // "Creates a Color from a color name (W3C name). A hex value may be supplied as a string in the format "#ffffff"." + color := tcell.GetColor(c) + return color } - - return tcell.ColorPink }