-
Notifications
You must be signed in to change notification settings - Fork 144
Add colors to --help/-h #745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@starsep Per #574, |
09e792c to
1e10c2b
Compare
|
Actually
|
|
Hi @starsep, thanks for your PR. |
|
I was aware of clap changes but not of this discussion, thanks! Default |
|
@starsep Is your screenshot still accurate after your latest change? I notice the styles you've set aren't identical to clap_cargo. Did you prefer the non-bright colours? Btw, if you feel strongly about colours it might be good if you add your feedback to the clap discussion, seeing as they're looking for input. |
|
Yeah, I don't have strong feelings either. I'm just wondering if the "bright" colours used in clap-cargo might be better for readability. |
|
A stronger contrast is helpful in low-light or -vision (a11y) scenarios, if 1 is already overriding user's TUI setup a bit via color. |
|
Most terminal themes adjust the ANSI colors requested by programs as needed so that they are somewhat readable anyway when considering the likely surrounding colors. For example, here is the colored output of Therefore, as Monokai is a reasonably well-calibrated theme, I think chances are that it'll look also fine in most other well-done themes, and the responsibility of ensuring proper contrast is moved to either theme authors or end-users selecting the theme they feel the most comfortable with. In my view, now that accessibility concerns are set aside, choosing the most beautiful color palette for Oxipng is bound to be an endless debate where everyone will very reasonably have their own preference, so I don't think we should aim to resolve that in this PR. Instead, I think that we could be more pragmatic and consider that some color is arguably better than no color, because the usage of different colors has been shown to help shape interactions of people with different parts of an UI, and we want that here to make it easier for people to read the documentation. (After all, most people can't really imagine a code editor that doesn't do any syntax highlighting with different colors, right?) So, let's merge this! π |
1e10c2b to
d7f208a
Compare
|
@AlexTMjugador @andrews05 @starsep Screenshots attached (system dark and light themes). Workaround for macOS users: |
|
@AlexTMjugador you're posting screenshots from cargo, but as noted earlier the colours set here aren't identical. Are you sure we don't want to match? If cargo's colours are commonly used, it might be good for consistency. @ace-dent I'm afraid I don't have much helpful to say on the matter, other than colours are hard. It's true that the colours don't stand out as much on the light theme there but I think it's probably acceptable. People who really struggle with colours will likely have already tailored their theme to work for them. |
Besides Cargo, I've also tested a random selection of CLI apps I had readily available (Docker, Hyperfine, yt-dlp, vim, psql, oggenc, btop, k9s, nix) in my KDE Breeze terminal theme and the result were basically far from consistent:
So I don't think there is anything close to a widely-observed standard in what colors CLI apps should use for "manual-like" output, and thus Oxipng picking a somewhat random choice here is basically equivalent to what other apps do.
Yeah, the light terminal themes usually come across as worse in contrast, in my opinion. Some people prefer that, though. I'd say that particular themes looking worse is not anything we should try to fix on the Oxipng side of things, because the precise colors used are highly dependent on the precise terminal configuration, and thus asking the terminal to print reasonably different colors is the best we can do (and are already doing): they may end up being completely different anyway. |
|
Well I think someone ought to come up with a standard for everyone to use π |
@andrews05 You have successfully incanted⦠the obligatory xkcd! |
I used clap-cargo as it's easy to use and provides sensible default styles.User can disable colors via
NO_COLOR=1environment variableOutput of
oxipng --help:NO_COLOR=1