Live data from Hacker News

How to choose colors for your CLI applications (2023)

blog.xoria.org

11–20 of 103 posts

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

#11

[flagged]

Accommodating terminal colour schemes, however crazy to you they might be—white on black, black on white, dark brown on off-white Solarized-style, etc.—is basics of TUI design.

Personally I alternate between light on dark and dark on light (the latter sometimes together with OS-wide colour inversion feature).

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

#12

[flagged]

> People who use white themed terminals are psychopaths anyway

Dark background is hell for anyone with astigmatism. It’s fine with 80x24 (vga text mode), but for anything higher feels like light needles on the retina. With astigmatism everything that is bright and small is duplicated, which means small characters is very difficult to read.

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

#15
post #6

Earlier quoted context omitted.

> 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.

More importantly, dont use color as sole source of information. Strikethrough, emoji or ok / bad can also be used.

Emojis aren't 7-bit clean. They're hard to type. They don't mean things the same way words do. `foo | grep -i error` communicates intent better than `foo | grep :-/` or whatever goofy hieroglyph someone chose instead of, like, a word with clearly defined meaning.

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

#16
post #7

Earlier quoted context omitted.

Red/green is semantic in these cases. They’re user configurable in almost all terminals, so there’s no real accessibility issue. I tend to associate blue with decorative accent, yellow with info/warning text, and cyan and magenta for really fancy stuff.

Red/green has no inherent semantics. It has the semantics that you assign it. If you choose to assign it meaning that disenfranchises 8% of men using your system, that's your choice, but it is not a good one.

Cultural semantics (diff tools, build tools,…: green/addition/ok, red/removal/error). And people with color blindness can alter the colors to something they can differentiate. And in the ansi sequences, they are actually numbers.

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

#17

This is true for the console in dev tools as well. Problem there is you can’t change css so at the moment the systems color preference changes thing will look bad. Important considerations for custom formatters.

Here is a screenshot for my personal example:

https://github.com/workglow-dev/workglow/blob/main/docs/deve...

Play with it here using dev tools (you can ignore the website itself): https://workglow-web.netlify.app/

Docs including útil for checking dark mode: https://github.com/workglow-dev/workglow/tree/main/packages/...

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

#18

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.

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

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

#19
post #7

Earlier quoted context omitted.

Red/green is semantic in these cases. They’re user configurable in almost all terminals, so there’s no real accessibility issue. I tend to associate blue with decorative accent, yellow with info/warning text, and cyan and magenta for really fancy stuff.

Red/green has no inherent semantics. It has the semantics that you assign it. If you choose to assign it meaning that disenfranchises 8% of men using your system, that's your choice, but it is not a good one.

The standard terminal palette is only 16 colors. Even if you compress them all into the green-to-blue color range, it's still possible to distinguish all 16. The user can change "red" and "green" to whatever they like in the terminal preferences and then every 16-color app will be accessible with no additional effort from anybody.

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

#20

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.

This approach is worse. Use red and green like everyone else and the user can choose their terminal color palette to differentiate in a way that works for them. Then it works the same across all commands. If you're the odd one out, you're adding more mental overhead for the user, not less.
Post reply on HN