Fix support for transparent backgrounds

pull/232/head
Simon Roberts 3 years ago
parent 0342e97b28
commit bc9ea240e4
No known key found for this signature in database
GPG Key ID: 0F30F99E6B771FD4

@ -108,14 +108,19 @@ func fixColor(c tcell.Color) tcell.Color {
}
func mkStyle(fg, bg Attribute) tcell.Style {
st := tcell.StyleDefault
b := tcell.ColorDefault
if bg != ColorDefault {
b = tcell.PaletteColor(int(bg)&0x1ff - 1)
b = fixColor(b)
}
f := tcell.PaletteColor(int(fg)&0x1ff - 1)
b := tcell.PaletteColor(int(bg)&0x1ff - 1)
f := tcell.ColorDefault
if fg != ColorDefault {
f = tcell.PaletteColor(int(fg)&0x1ff - 1)
f = fixColor(f)
}
f = fixColor(f)
b = fixColor(b)
st = st.Foreground(f).Background(b)
st := tcell.StyleDefault.Foreground(f).Background(b)
if (fg|bg)&AttrBold != 0 {
st = st.Bold(true)
}

Loading…
Cancel
Save