use std::fmt::Display;
use std::io::stdout;
use std::io::Write;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd)]
pub enum Attribute {
Reset = 0,
Bold = 1,
Dim = 2,
Italic = 3,
Underlined = 4,
SlowBlink = 5,
RapidBlink = 6,
Reverse = 7,
Hidden = 8,
CrossedOut = 9,
Fraktur = 20,
NoBold = 21,
NormalIntensity = 22,
NoItalic = 23,
NoUnderline = 24,
NoBlink = 25,
NoInverse = 27,
NoHidden = 28,
NotCrossedOut = 29,
Framed = 51,
Encircled = 52,
OverLined = 53,
NotFramedOrEncircled = 54,
NotOverLined = 55,
#[doc(hidden)]
__Nonexhaustive,
}
impl Display for Attribute {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> std::result::Result<(), std::fmt::Error> {
write!(f, "{}", format!(csi!("{}m"), *self as i16))?;
stdout().flush().unwrap();
Ok(())
}
}