From 52c19173dfa162868be792d61a2e48e4bb6e0112 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 14 Oct 2024 16:31:53 -0600 Subject: [PATCH] video: Add a dark-grey console colour This is useful for highlighting something with a black background, as is needed with cedit when using a white-on-black console. Add this as a new colour. Signed-off-by: Simon Glass --- boot/scene.c | 2 +- drivers/video/video-uclass.c | 3 +++ include/video.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/boot/scene.c b/boot/scene.c index 270c9c67233..0135287cfcb 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -339,7 +339,7 @@ static void scene_render_background(struct scene_obj *obj, bool box_only) /* draw a background for the object */ if (CONFIG_IS_ENABLED(SYS_WHITE_ON_BLACK)) { - fore = VID_BLACK; + fore = VID_DARK_GREY; back = VID_WHITE; } else { fore = VID_LIGHT_GRAY; diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 9823673f817..a5b3e898066 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -294,6 +294,9 @@ static const struct vid_rgb colours[VID_COLOUR_COUNT] = { { 0xff, 0x00, 0xff }, /* bright magenta */ { 0x00, 0xff, 0xff }, /* bright cyan */ { 0xff, 0xff, 0xff }, /* white */ + + /* an extra one for menus */ + { 0x40, 0x40, 0x40 }, /* dark gray */ }; u32 video_index_to_colour(struct video_priv *priv, enum colour_idx idx) diff --git a/include/video.h b/include/video.h index 606c8a37fb8..fd19723b1d2 100644 --- a/include/video.h +++ b/include/video.h @@ -181,6 +181,7 @@ enum colour_idx { VID_LIGHT_MAGENTA, VID_LIGHT_CYAN, VID_WHITE, + VID_DARK_GREY, VID_COLOUR_COUNT };