fn apply_sgr(&mut self, code: u8) {
        match code {
            0 => *self = CharacterAttribute::default(),
            4 => self.underline = true,
            7 => self.reverse = true,
            9 => self.strikethrough = true,
            24 => self.underline = false,
            27 => self.reverse = false,
            29 => self.strikethrough = false,
            30...37 | 90...97 => self.foreground = ConsoleColor::from_console_code(code).unwrap(),
            40...47 | 100...107 => self.background = ConsoleColor::from_console_code(code - 10).unwrap(),
            _ => { /* unimplemented!() */ }
        }
    }
/// Parse and apply SGR (Select Graphic Rendition) parameters.
Parse and apply SGR (Select Graphic Rendition) parameters.
Parse and apply SGR ( Select Graphic Rendition ) parameters .
fn apply_sgr(&mut self, code: u8) {
        match code {
            0 => *self = CharacterAttribute::default(),
            4 => self.underline = true,
            7 => self.reverse = true,
            9 => self.strikethrough = true,
            24 => self.underline = false,
            27 => self.reverse = false,
            29 => self.strikethrough = false,
            30...37 | 90...97 => self.foreground = ConsoleColor::from_console_code(code).unwrap(),
            40...47 | 100...107 => self.background = ConsoleColor::from_console_code(code - 10).unwrap(),
            _ => { /* unimplemented!() */ }
        }
    }
fn apply_sgr ( & mut self , code : u8 ) { match code { 0 => * self = CharacterAttribute :: default ( ) , 4 => self . underline = true , 7 => self . reverse = true , 9 => self . strikethrough = true , 24 => self . underline = false , 27 => self . reverse = false , 29 => self . strikethrough = false , 30 ... 37 | 90 ... 97 => self . foreground = ConsoleColor :: from_console_code ( code ) . unwrap ( ) , 40 ... 47 | 100 ... 107 => self . background = ConsoleColor :: from_console_code ( code - 10 ) . unwrap ( ) , _ => { /* unimplemented!() */ } } }
Parse and apply SGR (Select Graphic Rendition) parameters.
Parse and apply SGR ( Select Graphic Rendition ) parameters .
&mut self
code
u8
&mut self
code
u8