AriaMinaei/pretty-error

default theme is tough to read on a white background

Opened this issue · 6 comments

Oops, this one slipped! Sorry :)

I just looked at the screenshot. Are we sure that's what's supposed to happen? I assume terminals have themes and each theme would set an alternative color for every default color (like, when BG is in white, then white text would appear as black).

This is what the light theme looks like in my console (ConEmu):
untitled-1

hm... i wonder if there is a way to detect the terminal background. I can confirm that the default theme is tough to read on the default terminal on mac.

default

i wonder if there is a way to detect the terminal background.

It looks like there is.

I can confirm that the default theme is tough to read on the default terminal on mac.

It's probably easy for us to make a theme for white background, but that would mean that every package that uses RenderKid should include an alternative theme too, or simply ignore light colors altogether. I wonder if there is another way to ensure compatibility with light bg.

OS X Terminal has configurable colors. The default theme ("Basic") maps ANSI "bright white" to very light grey, which is barely visible on white (default) background. User can fix the issue by changing "bright white" to more dark in Terminal settings.

Because terminals can have any combination of default foreground / background colors, I don't think universal "safe" combinations really exist, so it's up to the terminal program to map colors in readable way.

So, althought the issue is arguably OS X Terminal's fault, it would be nice if pretty-error used a combination of colors that plays nice with most popular terminals (OS X Terminal being one of them?), e.g. replace ANSI "bright white" with ANSI "default foreground color".

Terminal:

image

Manually-selected region:

image

... Konsole terminal in Arch Linux ... Honestly, for me having readable, simplified error messages trumps "prettified" output.

This is still a problem, and I don't want to reassign bright-white in my terminal because that would break other styles that provide their own background and want to set the foreground to bright white to compensate. Instead, as a workaround, you can unset the color, which seems to work nicely since the theme is designed for black backgrounds and you'll get whatever the appropriate default text color you've set is:

{
  'pretty-error > header > message': {
    color: 'none',
  },
}