mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Fix colors using blend
This commit is contained in:
parent
62c9e2f02c
commit
374f90a348
1 changed files with 10 additions and 3 deletions
|
@ -5,13 +5,20 @@ use std::str;
|
|||
use tui::style::{Color, Modifier, Style};
|
||||
|
||||
pub fn blend(style: Style, c: TColor) -> Style {
|
||||
let mut style = style.fg(c.fg);
|
||||
let mut style = style;
|
||||
|
||||
if style.fg.is_none() || c.fg != Color::Reset {
|
||||
style = style.fg(c.fg);
|
||||
}
|
||||
|
||||
if style.bg.is_none() || c.bg != Color::Reset {
|
||||
style = style.bg(c.bg);
|
||||
}
|
||||
for modifier in c.modifiers {
|
||||
style = style.add_modifier(modifier);
|
||||
|
||||
for m in c.modifiers {
|
||||
style = style.add_modifier(m);
|
||||
}
|
||||
|
||||
style
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue