Live data from Hacker News

How to choose colors for your CLI applications (2023)

blog.xoria.org

31–40 of 103 posts

Re: How to choose colors for your CLI applications (2023)

#31
I recently spent several evenings re-working all of my colours across all of my computers and screens; terminals, IDEs, etc. Ultimately, despite using the same tools, and always dark mode, across all of my machines, the setup for each was different.

I think it's safe to set a standard colour-set so that it's immediately usable, but beyond that, a user should be customising to their requirements.

Perception differs among people; many of the colours OP listed as unreadable, were barely an issue, bright yellow being the only one I could unequivocally agree on. Perhaps display type, configuration and colour calibration is an important factor, as well as individual perception, ambient conditions, brightness levels, contrast, and perhaps even more variables have a significant effect.

I've also learned, since adding an OLED Monitor to my desk alongside the IPS ones, that it's possible to have too much contrast; brightly coloured text alongside pixels that are literally off can be just as problematic to read at times, as low-contrast.

Re: How to choose colors for your CLI applications (2023)

#32

Use only default (white/black), red for bad, green for good. If you need more than that, like vim or whatever, then maybe a 'fullscreen' TUI is better, with a specified background and foreground. For CLI tools, I'm not sure if I prefer more colours. The CSS to make the terminals look like iTerm was smooth, to the point I read them as screenshots.

> red for bad, green for good 8% of men of Northern European descent (and 0.4% of women) are red-green colorblind. That'd be a terrible choice. Use blue-orange, blue-red, or purple-green.

You are ignoring that most people already have a cultural understanding of the colors red and green. Changes done for accessibility should never making things worse for the average user.

Re: How to choose colors for your CLI applications (2023)

#33
post #22
post #18

Earlier quoted context omitted.

Hard disagree on the red/green. Use whatever you think appropriate and make it user configurable.

It's a CLI app, it's already configurable. Every good terminal emulator lets you set custom palettes.

>Every good terminal emulator lets you set custom palettes

Not differently for each program's output.

Re: How to choose colors for your CLI applications (2023)

#35
post #33
post #22

Earlier quoted context omitted.

It's a CLI app, it's already configurable. Every good terminal emulator lets you set custom palettes.

>Every good terminal emulator lets you set custom palettes Not differently for each program's output .

Which is a good reason to stick with the de-facto standard of red for bad and green for good.

Re: How to choose colors for your CLI applications (2023)

#36

If the goal of the post is to pick terminal colors that contrast on both white/light and black/dark backgrounds, it means you're stuck with midtone colors (between light and dark). This is really limiting for color choice (there's no such thing as "dark yellow" for example), and lowers the maximum contrast you can have for text because you get the best contrast when one color is dark and the other is light. Ideally,…

CLI apps can detect the background color of the terminal, and determine contrasting colors accordingly.

Re: How to choose colors for your CLI applications (2023)

#38

If the goal of the post is to pick terminal colors that contrast on both white/light and black/dark backgrounds, it means you're stuck with midtone colors (between light and dark). This is really limiting for color choice (there's no such thing as "dark yellow" for example), and lowers the maximum contrast you can have for text because you get the best contrast when one color is dark and the other is light. Ideally,…

CLI apps can detect the background color of the terminal, and determine contrasting colors accordingly.

They can? Is this a recent thing? I remember wanting to detect the background colour years ago, and not finding any way to do it.

Re: How to choose colors for your CLI applications (2023)

#39
As long as CLI programs stick to the 8 or 16 standard colors and refrain from setting background colors (inverse mode is fine), as well as from explicitly setting white or black as text color, everyone can reasonably configure their terminal colors so that everything is readable.

When going beyond that, the colors really need to be configurable on the application.

Post reply on HN