From 510a596849cfdac0147d5f68a5a7ea18fc97d243 Mon Sep 17 00:00:00 2001 From: Guillaume DIDIER Date: Mon, 4 Nov 2019 13:54:01 +0100 Subject: [PATCH] Add preliminary VGA color support. (This API is not complete) --- vga_buffer/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vga_buffer/src/lib.rs b/vga_buffer/src/lib.rs index b604e43..412fd3d 100644 --- a/vga_buffer/src/lib.rs +++ b/vga_buffer/src/lib.rs @@ -283,6 +283,10 @@ pub fn _print(args: fmt::Arguments) { WRITER.lock().write_fmt(args).unwrap(); } +pub fn set_colors(fg: ForegroundColor, bg: Color) { + WRITER.lock().color_code = ColorCode::new(fg, bg); +} + lazy_static! { pub static ref WRITER: Mutex = Mutex::new(Writer::new( ColorCode::new(ForegroundColor::Yellow, Color::Blue),