Hacker News new | past | comments | ask | show | jobs | submit login

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




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!


<3 TUI FTW


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: