mookid/diffr

Improve default coloring contrast

Closed this issue · 8 comments

xeruf commented

IntelliJ Idea Terminal:
image
image
Konsole:
image

I understand that the tool should by default only highlight the character changes and leave everything else untouched - however, white on bright green is barely legible, especially if, as in the first two examples the white isn't a pure white.

Couldn't you use a dark green background or smth?

Relation

Seems this originates from #31 - if the reason is that you don't want to add any colors, maybe you could make the text on the green background black again.

I figured, the reason is that "black" color more likely to blend with the dark "green" and "red" than white color.

Idk why, but in my case it is a bright and not a dark green ^^

I see the same thing from vscode; there I added "terminal.ansiBrightWhite": "#EEEEEE" in the config.

default:
image

with the new setting:
image

does that help?

xeruf commented

it seems that ansi white is already supposed to be white in the terminal:
image

either way, that doesn't change the fact that even in a normal terminal the contrast of pure white on bright green is barely legible

in that case, you should use the appropriate flags to change the foreground color to something you like; it is unlikely that a single set of default settings is perfect for each scenario.

xeruf commented

can you show me any case where white on green works well? None of the screenshots in this thread indicate that.

the second screenshot I posted renders as intended.

The option to change to almost any styling available in the console is given via the --colors flag, so that users are not stuck because of defaults.

About the defauIt config, I welcome any proposal, under the following constrains:

  • the same config should work out of the box on all supported OSs (which limits to a 16 colors palette because of the windows console)
  • bonus points for added=green, removed=red (because this is how git diff styles the diff)
xeruf commented

the second screenshot I posted renders as intended.

yes, I know that that is the currently intended state, but we can agree that white on bright green is not sufficient contrast?

Does the default currently use ANSI green or bright green? I think simply using a darker color (ideally still green) as background would be fine.

can you show me any case where white on green works well? None of the screenshots in this thread indicate that.

None of the "bad" screenshots show white letters though. I mean, look, it is clearly gray not white. This thread so far has just two shots where white is an actual white and I don't think you'd deny it works in these two cases.

So, that's the real problem: white not being white.

And I think I know a solution. Look at this table:

image

The real white is called "bright white", whereas "white" most often is shown as gray.

So setting the color to "bright white" should fix that.

Should be fixed by #83