Skip to contentSkip to conversation

alsamixer: use background color instead of COLOR_BLACK

DISCUSSION GitHub pull_request - opened 2 participants 2 messages Feb 6, 2021 – Jun 8, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

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

#2 lore raw
Quoted 25 lines · GitHub pull_request - opened

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.

Quoted 8 lines

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?

alsamixer/colors.c +4 -4
@@ -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);