lib-nested/nested/src/color.rs

26 lines
778 B
Rust
Raw Normal View History

2022-06-19 23:13:21 +02:00
use {
crate::terminal::TerminalStyle,
};
pub fn bg_style_from_depth(depth: usize) -> TerminalStyle {
2022-08-12 18:57:40 +02:00
match depth {
2022-10-15 03:52:38 +02:00
0 => TerminalStyle::bg_color((150,80,230)),
1 => TerminalStyle::bg_color((35,35,35)),
2 => TerminalStyle::bg_color((10,10,10)),
_ => TerminalStyle::default(),
2022-06-19 23:13:21 +02:00
}
}
pub fn fg_style_from_depth(depth: usize) -> TerminalStyle {
match depth % 6 {
0 => TerminalStyle::fg_color((40, 180, 230)),
1 => TerminalStyle::fg_color((120, 120, 120)),
2022-10-15 03:52:38 +02:00
2 => TerminalStyle::fg_color((250, 165, 40)),
3 => TerminalStyle::fg_color((80, 180, 200)),
2022-10-15 03:52:38 +02:00
4 => TerminalStyle::fg_color((180, 240, 85)),
5 => TerminalStyle::fg_color((200, 190, 70)),
2022-06-19 23:13:21 +02:00
_ => TerminalStyle::default()
}
}