From d026c19b1622b38fa92f3d7fba2eca42f6575efa Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 5 Jun 2025 22:59:22 -0400 Subject: kernel: cons: Add color attribute helpers Signed-off-by: Ian Moffett --- sys/dev/cons/cons.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sys/dev/cons') diff --git a/sys/dev/cons/cons.c b/sys/dev/cons/cons.c index 61254a7..0e22bb5 100644 --- a/sys/dev/cons/cons.c +++ b/sys/dev/cons/cons.c @@ -378,6 +378,23 @@ cons_init_bufs(struct cons_screen *scr) return 0; } +/* + * Reset console color. + */ +void +cons_reset_color(struct cons_screen *scr) +{ + g_root_scr.fg = CONSOLE_FG; + g_root_scr.bg = CONSOLE_BG; +} + +void +cons_update_color(struct cons_screen *scr, uint32_t fg, uint32_t bg) +{ + scr->fg = fg; + scr->bg = bg; +} + /* * Put a character on the screen. * -- cgit v1.2.3