alsamixer: use background color instead of COLOR_BLACK

Richard Narron richard at aaazen.com
Tue Jun 8 18:13:38 CEST 2021


On Sat, 6 Feb 2021, GitHub pull_request - opened wrote:

> alsa-project/alsa-utils pull request #77 was opened from r-burns:
>
> Hi! I have a cosmetic "improvement" I'd like to share. Scare quotes
> because this is possibly opinionated, but I'd still like to know what
> you think.
>
> I think on typical terminals, COLOR_BLACK is the same or quite similar
> to the background color, so this does not make much of a difference. But
> on "solarized" color schemes and similar, the COLOR_BLACK may be quite
> different from the background color, so in my opinion it looks odd to
> have the alsamixer panel stand out this way. For example, I'm using the
> "Nord" color scheme on a pitch black #000000 background, and here's how
> the mixer looks with/without this patch (blank terminal, htop, and
> ncmpcpp also provided for comparison):
>
> ![image](https://user-images.githubusercontent.com/52847440/107131140-dbf46500-6888-11eb-938a-9a3258bf7184.png)
>
> As you can see, the current alsamixer in the center looks a bit strange
> and sticks out
>  against my chosen background color and the other TUIs I'm using. Htop
> and ncmpcpp agree on using the builtin `-1` background color for their
> own backgrounds, but alsamixer uses COLOR_BLACK which stands out from
> the actual background. The alsamixer on the bottom right is using this
> patch, and blends in seamlessly.
>
> Again, this is just my opinion! Feel free to close if this is wrong or
> superfluous. Nonetheless, I thought I'd share this patch, in case anyone
> else feels the same way.
>
> Request URL : https://github.com/alsa-project/alsa-utils/pull/77 Patch
> URL : https://github.com/alsa-project/alsa-utils/pull/77.patch
> Repository URL: https://github.com/alsa-project/alsa-utils
>

This alsamixer patch made it alsa-utils 1.2.5 (and Slackware current) but
it gives me problems.

I have a terminal with a white background (XTerm default), so the white
characters do not appear at all and the yellow characters are extremely
hard to read.

My simple solution is to revert patch:
c867aa8a84a7e9fbf7f9547a3462f8521cfc69b0

Perhaps a better solution could be developed to allow the foreground and
background colors to be changed by the user?

Signed-off-by: Richard Narron <richard at aaazen.com>

--- alsa-utils-1.2.5/alsamixer/colors.c	2021-05-27 10:18:36.000000000 -0700
+++ alsa-utils-1.2.4/alsamixer/colors.c	2020-10-15 04:32:33.000000000 -0700
@@ -50,11 +50,11 @@
 		start_color();
 		use_default_colors();

-		get_color_pair(COLOR_CYAN, -1); // COLOR_PAIR(1)
-		get_color_pair(COLOR_YELLOW, -1);
+		get_color_pair(COLOR_CYAN, COLOR_BLACK); // COLOR_PAIR(1)
+		get_color_pair(COLOR_YELLOW, COLOR_BLACK);
 		get_color_pair(COLOR_WHITE, COLOR_GREEN);
-		get_color_pair(COLOR_RED, -1);
-		get_color_pair(COLOR_WHITE, -1);
+		get_color_pair(COLOR_RED, COLOR_BLACK);
+		get_color_pair(COLOR_WHITE, COLOR_BLACK);
 		get_color_pair(COLOR_WHITE, COLOR_BLUE);
 		get_color_pair(COLOR_RED, COLOR_BLUE);
 		get_color_pair(COLOR_GREEN, COLOR_GREEN);


More information about the Alsa-devel mailing list