From 851e079a82f9795387d299c92a38a6290a23bf3a Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Sat, 19 Dec 2020 02:11:38 +0300 Subject: [PATCH] Fix colors for BSD style LSCOLORS for tcell/v2 Related #526 --- colors.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/colors.go b/colors.go index 64b5980..93b0365 100644 --- a/colors.go +++ b/colors.go @@ -164,9 +164,9 @@ func parseStylesBSD(env string) styleMap { case r1 == 'x': st = st.Foreground(tcell.ColorDefault) case 'A' <= r1 && r1 <= 'H': - st = st.Foreground(tcell.Color(r1 - 'A')).Bold(true) + st = st.Foreground(tcell.PaletteColor(int(r1 - 'A'))).Bold(true) case 'a' <= r1 && r1 <= 'h': - st = st.Foreground(tcell.Color(r1 - 'a')) + st = st.Foreground(tcell.PaletteColor(int(r1 - 'a'))) default: log.Printf("invalid $LSCOLORS entry: %c", r1) return tcell.StyleDefault @@ -176,7 +176,7 @@ func parseStylesBSD(env string) styleMap { case r2 == 'x': st = st.Background(tcell.ColorDefault) case 'a' <= r2 && r2 <= 'h': - st = st.Background(tcell.Color(r2 - 'a')) + st = st.Background(tcell.PaletteColor(int(r2 - 'a'))) default: log.Printf("invalid $LSCOLORS entry: %c", r2) return tcell.StyleDefault