MCPcopy Create free account
hub / github.com/endbasic/endbasic / set_color

Method set_color

std/src/console/graphics.rs:545–551  ·  view source on GitHub ↗
(&mut self, fg: Option<u8>, bg: Option<u8>)

Source from the content-addressed store, hash-verified

543 }
544
545 fn set_color(&mut self, fg: Option<u8>, bg: Option<u8>) -> io::Result<()> {
546 self.ansi_fg_color = fg;
547 self.fg_color = ansi_color_to_rgb(fg.unwrap_or(self.default_fg_color));
548 self.ansi_bg_color = bg;
549 self.bg_color = ansi_color_to_rgb(bg.unwrap_or(self.default_bg_color));
550 Ok(())
551 }
552
553 fn enter_alt(&mut self) -> io::Result<()> {
554 if self.alt_backup.is_some() {

Callers 1

newMethod · 0.45

Calls 1

ansi_color_to_rgbFunction · 0.85

Tested by

no test coverage detected