pub trait Colorize {
fn bold(&self) -> String;
fn red(&self) -> String;
fn green(&self) -> String;
fn yellow(&self) -> String;
fn blue(&self) -> String;
fn cyan(&self) -> String;
fn bright_red(&self) -> String;
fn bright_green(&self) -> String;
fn bright_blue(&self) -> String;
fn bright_cyan(&self) -> String;
}
impl<T: AsRef<str>> Colorize for T {
fn bold(&self) -> String {
format!("\x1b[1m{}\x1b[0m", self.as_ref())
}
fn red(&self) -> String {
format!("\x1b[31m{}\x1b[0m", self.as_ref())
}
fn green(&self) -> String {
format!("\x1b[32m{}\x1b[0m", self.as_ref())
}
fn yellow(&self) -> String {
format!("\x1b[33m{}\x1b[0m", self.as_ref())
}
fn blue(&self) -> String {
format!("\x1b[34m{}\x1b[0m", self.as_ref())
}
fn cyan(&self) -> String {
format!("\x1b[36m{}\x1b[0m", self.as_ref())
}
fn bright_red(&self) -> String {
format!("\x1b[91m{}\x1b[0m", self.as_ref())
}
fn bright_green(&self) -> String {
format!("\x1b[92m{}\x1b[0m", self.as_ref())
}
fn bright_blue(&self) -> String {
format!("\x1b[94m{}\x1b[0m", self.as_ref())
}
fn bright_cyan(&self) -> String {
format!("\x1b[96m{}\x1b[0m", self.as_ref())
}
}