style(tui): use better colors when background color is set to reset

This commit is contained in:
Orhun Parmaksız 2023-09-13 23:24:05 +03:00
parent fed4fad7e0
commit 3f862ffcdd
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -31,7 +31,11 @@ impl Colors {
/// Returns the background/foreground colors with default style.
pub fn get_style(&self) -> Style {
Style::default().bg(self.fg).fg(self.bg)
if self.bg == TuiColor::Reset {
Style::default().bg(TuiColor::White).fg(TuiColor::Black)
} else {
Style::default().bg(self.fg).fg(self.bg)
}
}
/// Returns the background color with default style.