News for hackers. Stuff that matters.
Re:Hacking the planet with Notcurses: a guide to TUIs (2020)... by akkartik on Sunday December 05, 2021 @04:30PM (#29453507)
From page 8:

"We don’t switch from blue to some other specified color, because we don’t know the background color of the terminal. Some people, possibly aliens, don’t favor a dark terminal background. If the terminal background were white, and we had just used e.g. ncdirect_fg(n, 0xffffff), text following “house” would be invisible.

"One might observe that a user with a blue background will have invisible “house” text. This is a real issue, one lacking a perfect solution. It is not generally possible to discover the RGB values of the default colors. I suppose all one can do is rest easy, serene in the belief that white backgrounds are one thing, but people with chromatic backgrounds deserve whatever happens to them."

That's a lot of cognitive dissonance in a work about UI design. Let's try to do better in making TUIs mainstream. That requires encouraging people to use the few features terminals _do_ provide. Like chromatic backgrounds.

I've been doing a fair amount of ncurses hacking recently[1], and I prefer to always explicitly specify colors. People won't get their preferred colors by default, but they'll always get a legible configuration by default.

[1] https://github.com/akkartik/teliva

Re:Hacking the planet with Notcurses: a guide to TUIs (2020)... by dankamongmen on Sunday December 05, 2021 @11:12PM (#29456057)
WITH THAT SAID, Notcurses can now acquire the default background from the terminal (this was not true when I wrote the book, sigh), and I fully support @akkartik's approach given this fact. Using NCALPHA_HIGHCONTRAST together with explicit reproduction of the user's chosen background is a complete and general solution to this problem, and I really ought update the book. Thanks, @akkartik!
Re:Hacking the planet with Notcurses: a guide to TUIs (2020)... by akkartik on Sunday December 05, 2021 @11:42PM (#29456236)
<3 TUI FTW
Re:Hacking the planet with Notcurses: a guide to TUIs (2020)... by paulryanrogers on Sunday December 05, 2021 @04:35PM (#29453544)
This same problem has plagued the web for decades. I used to change default colors to ease my eyes, and whenever foreground CSS lacked a background color it often became impossible to read. Accessibility modes came soon after but were too binary for me.

These days we have dark modes and more elaborate extensions. Still sometimes things don't align.

So thanks for at least specifying both.

Re:Hacking the planet with Notcurses: a guide to TUIs (2020)... by akkartik on Sunday December 05, 2021 @04:41PM (#29453589)
Yeah, it's a hard problem, and I liked that OP acknowledged that. But I liked less how it made a virtue of the bad situation. There's really no way to rest easy or be serene here.