use super::EnumColor;
use crate::{
ColorFormattable,
define_text_styles
};
define_text_styles! {
Reset = 0,
Bold = 1,
Dim = 2,
Italic = 3,
Underline = 4,
Blink = 5,
BlinkRapid = 6,
Reverse = 7,
Hidden = 8,
Strikethrough = 9
}
impl ColorFormattable for TextStyle {
fn format(&self, _: bool) -> String {
format!("\x1B[{}m", self.code())
}
}
impl EnumColor for TextStyle {
fn from_name(name: &str) -> Option<Self> {
Self::from_str(name).ok()
}
}