use std::ops::Add;

pub struct Color {
    pub escape_code: &'static str,
}

impl Color {
    pub const END: Color = Color { escape_code: "\x1B[0m"};
    pub const BOLD: Color = Color { escape_code: "\x1B[1m"};
    pub const ITALIC: Color = Color { escape_code: "\x1B[3m"};
    pub const UNDERLINED: Color = Color { escape_code: "\x1B[4m"};
    pub const PULSE: Color = Color { escape_code: "\x1B[5m"};
    pub const BLACK: Color = Color { escape_code: "\x1B[30m"};
    pub const RED: Color = Color { escape_code: "\x1B[31m"};
    pub const GREEN: Color = Color { escape_code: "\x1B[32m"};
    pub const YELLOW: Color = Color { escape_code: "\x1B[33m"};
    pub const BLUE: Color = Color { escape_code: "\x1B[34m"};
    pub const PURPLE: Color = Color { escape_code: "\x1B[35m"};
    pub const CYAN: Color = Color { escape_code: "\x1B[36m"};
    pub const GREY: Color = Color { escape_code: "\x1B[37m"};
}

impl Add<&str> for Color {
    type Output = String;

    fn add(self, rhs: &str) -> Self::Output{
        format!("{}{}{}", self.escape_code, rhs, "\x1B[0m")
    }
}