use crossterm::style::Color as Clr;
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Intensity {
Normal,
Bright,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Color {
Black(Intensity),
Red(Intensity),
Green(Intensity),
Yellow(Intensity),
Blue(Intensity),
Magenta(Intensity),
Cyan(Intensity),
White(Intensity),
Rgb(u8, u8, u8),
}
impl From<Color> for Clr {
fn from(clr: Color) -> Self {
use Color::*;
match clr {
Black(Intensity::Normal) => Clr::Black,
Black(Intensity::Bright) => Clr::DarkGrey,
Red(Intensity::Normal) => Clr::DarkRed,
Red(Intensity::Bright) => Clr::Red,
Green(Intensity::Normal) => Clr::DarkGreen,
Green(Intensity::Bright) => Clr::Green,
Yellow(Intensity::Normal) => Clr::DarkYellow,
Yellow(Intensity::Bright) => Clr::Yellow,
Blue(Intensity::Normal) => Clr::DarkBlue,
Blue(Intensity::Bright) => Clr::Blue,
Magenta(Intensity::Normal) => Clr::DarkMagenta,
Magenta(Intensity::Bright) => Clr::Magenta,
Cyan(Intensity::Normal) => Clr::DarkCyan,
Cyan(Intensity::Bright) => Clr::Cyan,
White(Intensity::Normal) => Clr::Grey,
White(Intensity::Bright) => Clr::White,
Rgb(r, g, b) => Clr::Rgb { r, g, b },
}
}
}