rtl_433
rtl_433 copied to clipboard
Add darker colors for light terminal backgrounds
This addresses hard to read colors on light terminal backgrounds.
We use the COLORFGBG
environment variable to detect a light background and then remove the bright/bold attribute from the foreground color.
If your terminal emulates bright colors with bold characters the light "theme" can be used to get non-bold (lighter) output.
Can be selected/tested by
- for dark backgrounds
COLORFGBG="15;0" rtl_433 …
- for light backgrounds
COLORFGBG="0;15" rtl_433 …
Modern terminals will already set this appropriately, check with echo $COLORFGBG
This came up in #2823
@dreirund please review.
Can you also please make a case for this unreadable time
field.
I had to patch it with:
--- a/src/output_file.c 2024-03-08 14:25:55
+++ b/src/output_file.c 2024-03-08 15:47:10
@@ -158,7 +158,7 @@
if (!key || !*key)
return TERM_COLOR_RESET;
if (!strcmp(key, "tag") || !strcmp(key, "time"))
- return TERM_COLOR_BLUE;
+ return TERM_COLOR_BRIGHT_WHITE;
if (!strcmp(key, "model") || !strcmp(key, "type") || !strcmp(key, "id"))
return TERM_COLOR_RED;
if (!strcmp(key, "mic"))
BTW, the TFA-TwinPlus is totally out-of-wack. Another issue maybe later.
Do you have something like COLORFGBG="15;4"
in that terminal? Is the theme a Windows default or a selection or user setting?
Do you have something like COLORFGBG="15;4" in that terminal?
I do not understand. I'm on Windows and COLORFGBG
is a Gnome thing AFAICS.
Is the theme a Windows default or a selection or user setting?
A user setting from the WinCon settings dialogue:
That COLORFGBG
is just a plain env var that some terminals set and support for that mechanism is easy. (I don't dare look into the ANSI-escape magic to make terminals report color configuration.)
You can only set a background color in WinCon (sorry, is that the name? Is it Windows Console?) and not the full color scheme, can you? Otherwise I'd recommend mapping the blue color to something like cyan maybe.
The idea is that you could set COLORFGBG
fittingly and then rtl_433 could detect the bg color and remove that one color from the palette, e.g. replace it with white /fg.
.. and not the full color scheme, can you?
I guess not. Have not tried ColorTool and rtl_433. But I have yet to try this patch here to see if it works on WinCon.
@dreirund please review.
it seems to ignore COLORFGBG
variable.
@dreirund please review.
it seems to ignore
COLORFGBG
variable.
Now it works, we had a race condition here, seemed you just have added it to the code a few minutes ago when I was compiling and testing. Re-clone just gave me a very recent update of the code and now COLORFGBG="0;15"
works.