Skip to content

Commit

Permalink
fix: figure out colors
Browse files Browse the repository at this point in the history
  • Loading branch information
ctron committed Apr 22, 2024
1 parent 9d4e384 commit 09f2bcb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cmd/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ impl List {
"[year]-[month]-[day] [hour]:[minute]:[second]Z"
))?;

let (prefix, color) = if rem.is_positive() {
("valid", Color::Green)
let cell = if rem.is_positive() {
Cell::new(format!("valid: {format_rem} ({expires})")).fg(Color::Green)
} else {
("expired", Color::Grey)
Cell::new(format!("expired: {format_rem} ({expires})"))
.fg(Color::DarkGrey)
};

let cell =
Cell::new(format!("{prefix}: {format_rem} ({expires})")).fg(color);

row.add_cell(cell);
}
}
Expand Down

0 comments on commit 09f2bcb

Please sign in to comment.