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

Can't read highlighted test on bright terminal scheme #111

Open
Hubro opened this issue Apr 5, 2023 · 1 comment
Open

Can't read highlighted test on bright terminal scheme #111

Hubro opened this issue Apr 5, 2023 · 1 comment

Comments

@Hubro
Copy link

Hubro commented Apr 5, 2023

Due to real world brightness issues out of my control, I have to switch back and forth between a light and dark terminal scheme twice per day. rust-pretty-assertions look great in a dark scheme:

image

But as soon as I switch to my bright scheme, I can no longer make out the text in the highlighted sections:

image

(This is the Dayfox theme for Kitty)

It seems rust-pretty-assertions hard-codes the highlighted background colors, which I confirmed by setting every color in my terminal to red:

image

Would it perhaps be a better idea to use only ANSI color codes, so this can be controlled with the terminal's color scheme?

Is there anything I can do in the short term to keep rust-pretty-assertions usable during daytime? 😄

@tommilligan
Copy link
Collaborator

Hi @Hubro, thanks for your report!

pretty_assertions already uses ANSI codes, via the yansi library internally. However, I see that the background sections are highlighted with Fixed, which as you point out is a fixed color.

The color output was originally modelled after the output of the diff-highlight utility that ships with git as a sane default - this also uses fixed color codes I believe (though I could be wrong).

I'm basically open to switching to non-fixed colors, if you can propose a format that works well for your case and for existing users? I see diffr has a slightly different output which might work.

If you could propose a PR with updated styling, I'm happy to review

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

No branches or pull requests

2 participants