perf/tui: Change default selection background color to yellow
Hey acme,
it seems you've forgotten this one.
I still need it please :-)
Quoted 43 lines · Ingo Molnar
Boris reported that 'perf top' is unusable on his default 'black on white' terminal, which uses (eye friendly) light-grey as a background color.
The reason is that the TUI cursor for the current selection line uses
HE_COLORSET_SELECTED, and that has a default background color of 'lightgrey' - which is a common terminal background choice and thus the colors conflict.Use yellow as the background color instead: that should be an uncommon terminal background, yet it's still ergonomic on both black and white/grey terminals.
[ It would be a better solution to straight out detect color
collisions and resolve them reasonably by converting them to RGB and calculating color space distances, but I was unable to find proper documentation forSLtt_get_color_object()to recover the current color scheme so I gave up ... Yellow works well enough. ]Reported-by Borislav Petkov <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc David Binderman <[email protected]>Cc Jiri Olsa <[email protected]>Signed-off-by Ingo Molnar <[email protected]>--- tools/perf/ui/browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/ui/browser.c +1
-1@@ -499,7 +499,7 @@ static struct ui_browser_colorset { .colorset = HE_COLORSET_SELECTED, .name = "selected", .fg = "black", - .bg = "lightgray", + .bg = "yellow", }, { .colorset = HE_COLORSET_CODE,
Signature · 4 lines
Regards/Gruss,
Boris.
ECO tip #101: Trim your mails when you reply.Em Wed, Dec 09, 2015 at 10:55:16AM +0100, Borislav Petkov escreveu:
Quoted 5 lines
Hey acme,
it seems you've forgotten this one.
I still need it please :-)
Applying it now, thanks for the reminder.
- Arnaldo
Quoted 50 lines · Ingo Molnar
Quoted 43 lines
Boris reported that 'perf top' is unusable on his default 'black on white' terminal, which uses (eye friendly) light-grey as a background color.
The reason is that the TUI cursor for the current selection line uses
HE_COLORSET_SELECTED, and that has a default background color of 'lightgrey' - which is a common terminal background choice and thus the colors conflict.Use yellow as the background color instead: that should be an uncommon terminal background, yet it's still ergonomic on both black and white/grey terminals.
[ It would be a better solution to straight out detect color
collisions and resolve them reasonably by converting them to RGB and calculating color space distances, but I was unable to find proper documentation forSLtt_get_color_object()to recover the current color scheme so I gave up ... Yellow works well enough. ]Reported-by Borislav Petkov <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>Cc David Binderman <[email protected]>Cc Jiri Olsa <[email protected]>Signed-off-by Ingo Molnar <[email protected]>--- tools/perf/ui/browser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/ui/browser.c +1
-1@@ -499,7 +499,7 @@ static struct ui_browser_colorset { .colorset = HE_COLORSET_SELECTED, .name = "selected", .fg = "black", - .bg = "lightgray", + .bg = "yellow", }, { .colorset = HE_COLORSET_CODE,Signature · 4 lines
Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply.