uvm-plaid / uvmhs

2 stars 5 forks source link

Hardcoding background color can be problematic #7

Open Ptival opened 1 year ago

Ptival commented 1 year ago

The following create a couple of issues:

https://github.com/uvm-plaid/uvmhs/blob/a0ac0d780499d2a47906a10896c5d601d45b9903/src/UVMHS/Lib/Parser/ParserContext.hs#L48

  1. For users with a dark terminal, the foreground text is often white or close, resulting in almost zero contrast between background and foreground.
  2. Regardless of user background/foreground terminal, this also plays poorly with the current defaults, say for keywords.
image

In this screenshot, both effects can be seen, the double quotes, as well as the let keyword, are barely legible.

I feel like this ought to be configured via PrettyParams, so that users can at least override it.

davdar commented 1 year ago

Yes I've been meaning to support this!

I think we should do the following:

Additionally, I'd love a solution that automatically scrapes an environment variable to determine whether or not the terminal is in light or dark mode (there is an env variable for this, right?) I'm not sure the right place to put this logic, here are some options that come to mind:

davdar commented 1 year ago

Oh, and I left this implied but forgot to write it down... once we have good support for switching between light/dark mode, we'll want a good default prettyParams₀ for dark mode.