Fix colors for BSD style LSCOLORS for tcell/v2

Related #526
This commit is contained in:
Gokcehan committed 2020-12-19 02:11:38 +03:00
1 parent cae9ada56c
commit 851e079a82
1 file changed
+3 -3
+3 -3
View File
@@ -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