feat: add colors
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-05-30 23:05:00 +02:00
parent 73c6ba25b1
commit be28b4ff80
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912

View File

@ -4,6 +4,7 @@ use ratatui::prelude::*;
const GREEN: Color = Color::Rgb(127, 255, 0);
const ORANGE: Color = Color::Rgb(255, 165, 0);
const PURPLE: Color = Color::Rgb(138, 43, 226);
pub trait Summarize {
fn heading(&self) -> Vec<Span>;
@ -21,20 +22,20 @@ impl Summarize for MovementGraphItem {
vec![
name,
Span::from(" ~ "),
Span::from(format!("(items: {})", items)),
Span::from(" ~ ").fg(PURPLE),
Span::from(format!("(items: {})", items)).fg(Color::DarkGray),
]
}
GraphItemType::Item { done } => {
if done {
vec![
Span::from("["),
Span::from("[").fg(Color::DarkGray),
Span::from("x").fg(GREEN),
Span::from("] "),
Span::from("] ").fg(Color::DarkGray),
name,
]
} else {
vec![Span::from("[ ] "), name]
vec![Span::from("[ ] ").fg(Color::DarkGray), name]
}
}
}