From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH 4/5] fbconsole: use only one default color
Date: Sun, 1 Jun 2025 23:00:01 +0200 [thread overview]
Message-ID: <20250601210002.562733-4-a.fatoum@barebox.org> (raw)
In-Reply-To: <20250601210002.562733-1-a.fatoum@barebox.org>
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@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
next prev parent reply other threads:[~2025-06-01 21:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-01 20:59 [PATCH 1/5] fbconsole: use symbolic names for ANSI colors Ahmad Fatoum
2025-06-01 20:59 ` [PATCH 2/5] fbconsole: darken shade of non-bright white Ahmad Fatoum
2025-06-01 21:00 ` [PATCH 3/5] fbconsole: add support for aixterm bright colors Ahmad Fatoum
2025-06-01 21:00 ` Ahmad Fatoum [this message]
2025-06-01 21:00 ` [PATCH 5/5] fbconsole: reset cursor to origin when changing fonts Ahmad Fatoum
2025-06-01 21:02 ` Ahmad Fatoum
2025-06-02 7:42 ` (subset) " Sascha Hauer
2025-06-02 7:42 ` (subset) [PATCH 1/5] fbconsole: use symbolic names for ANSI colors Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250601210002.562733-4-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox