Skip to content
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

Use colors that support both dark and light color schemes #403

Open
heralden opened this issue Mar 16, 2023 · 5 comments
Open

Use colors that support both dark and light color schemes #403

heralden opened this issue Mar 16, 2023 · 5 comments

Comments

@heralden
Copy link

The default colors used in kaocha test outputs aren't readable if you're using a light color scheme.

Screenshot 2023-03-16 at 11 32 23

How about changing some of the colors so that they work for both dark and light color schemes?

@alysbrooks
Copy link
Member

I think this makes a lot of sense (and eventually, we probably want to add customization options).

@plexus
Copy link
Member

plexus commented Mar 22, 2023

Note that this is really a deep-diff2 concern, can we file an issue there and link to it from here?

Agreed on configurability, it's going to be hard to please everyone when it comes to colors. In which case it could be a kaocha concern to expose those configuration options.

@alysbrooks
Copy link
Member

I daresay this could also be an accessibility concern; I'm not sure our colors are colorblind friendly.

@alysbrooks
Copy link
Member

As an update on what we've found/discussed: We use the standard terminal colors and they're ultimately set by the terminal emulator. We may add some functionality to make changing the color scheme of deep-diff2 easier, but it is already possible to make that change, so one of our next steps is enabling that configuration from Kaocha.

What I'm leaning toward is making three changes to Kaocha:

  • A "fallback" option where we specify all colors and backgrounds to ensure good contrast. This would probably be dark mode, but maybe we could have both a light and dark fallback?
  • A configuration option that would allow you to specify either named terminal colors or RGB codes (probably something via a syntax like [200 150 0] and :red). We could document some possible options (e.g., a light scheme or a solarized-inspired one).
  • Respect the NO_COLOR environment variable: https://no-color.org/. It's not related to the original request, but a small change, and I think it's thematically related as it would allow Kaocha to accommodate more users' color preferences.

@plexus
Copy link
Member

plexus commented Apr 12, 2023

Thank you @alysbrooks , I like those proposals. Something I was also thinking about is that maybe we should have a scheme that people can easily switch to that's suitable for common forms of color blindness. The current red/green is pretty terrible in that regard.
We currently don't really have any "global" kaocha config, but for something like this it would be useful to be able to configure this outside any specific project (eg a user config file or env var).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Candidate
Development

No branches or pull requests

3 participants