[PATCH 4/5] fbconsole: use only one default color

Ahmad Fatoum a.fatoum at barebox.org
Sun Jun 1 14:00:01 PDT 2025


The default framebuffer color is (dark) white, which we also revert to
when resetting the default color and keeping style intact.

We also support the ANSI "reset all colors/styles" sequence and include
it in the default barebox prompt, but that one doesn't currently default
to white, but bright black (gray) instead.

Given that we have a pitch black background by default, dark white is
easier on the eyes than gray, so let's make that the singular default.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 drivers/video/fbconsole.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbconsole.c b/drivers/video/fbconsole.c
index b399c044be94..167569abd5c1 100644
--- a/drivers/video/fbconsole.c
+++ b/drivers/video/fbconsole.c
@@ -37,6 +37,8 @@ enum ansi_color {
 	BRIGHT
 };
 
+#define DEFAULT_COLOR	WHITE
+
 struct fbc_priv {
 	struct console_device cdev;
 	struct fb_info *fb;
@@ -495,7 +497,7 @@ static void fbc_parse_colors(struct fbc_priv *priv)
 		switch (code) {
 		case 0:
 			priv->flags = 0;
-			priv->color = BRIGHT + BLACK;
+			priv->color = DEFAULT_COLOR;
 			priv->bgcolor = BLACK;
 			break;
 		case 1:
@@ -508,7 +510,7 @@ static void fbc_parse_colors(struct fbc_priv *priv)
 			priv->color = code - 30;
 			break;
 		case 39:
-			priv->color = WHITE;
+			priv->color = DEFAULT_COLOR;
 			break;
 		case 40 ... 47:
 			priv->bgcolor = code - 40;
-- 
2.39.5




More information about the barebox mailing list