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

UCM ANSI colors invisible in popular color schemes #4510

Closed
runarorama opened this issue Dec 14, 2023 · 3 comments · Fixed by #4924
Closed

UCM ANSI colors invisible in popular color schemes #4510

runarorama opened this issue Dec 14, 2023 · 3 comments · Fixed by #4924
Labels

Comments

@runarorama
Copy link
Contributor

runarorama commented Dec 14, 2023

Here's iTerm2 with Solarized Dark, the most popular color scheme for iTerm2:

image

Here's iTerm2 with Gruvbox Light, another popular scheme:

image

Maybe we can make sure the screen is legible in like the top 6 most popular color schemes (in both dark and light variants):

  1. Solarized
  2. Monokai
  3. Gruvbox
  4. Nord
  5. Dracula
  6. Tomorrow Night
@pchiusano
Copy link
Member

Which ANSI colors are causing problems here? We could either not use those colors (seems like kind of a bummer) or submit PRs upstream, since this issue would affect any program using those color schemes with ANSI codes.

@fwip
Copy link

fwip commented Dec 14, 2023

It seems that it is unlikely that Solarized Dark will fix this upstream, unfortunately. Here's an open issue from 2012 tracking the problem. altercation/solarized#220

@pchiusano
Copy link
Member

Good grief, I just made the mistake of reading that thread and it made me sad. But yeah, let's not counting on upstream ever changing. :)

To fix this (PR welcome!!), check in ColorText.hs. It looks like we should avoid the HiBlack ANSI code (and Black too but I don't think we use that anywhere) since some color schemes have that very similar to the background color.

Also maybe just grep for Black and HiBlack.

defaultColors :: ST.Element r -> Maybe Color
defaultColors = \case
  ST.NumericLiteral -> Nothing
  ST.TextLiteral -> Nothing
  ST.BytesLiteral -> Just HiBlack
  ST.CharLiteral -> Nothing
  ST.BooleanLiteral -> Nothing
  ST.Blank -> Nothing
  ST.Var -> Nothing
  ST.TypeReference _ -> Nothing
  ST.TermReference _ -> Nothing
  ST.Op _ -> Nothing
  ST.Unit -> Nothing
  ST.AbilityBraces -> Just HiBlack
  ST.ControlKeyword -> Just Bold
  ST.LinkKeyword -> Just HiBlack
  ST.TypeOperator -> Just HiBlack
  ST.BindingEquals -> Nothing
  ST.TypeAscriptionColon -> Just Blue
  ST.DataTypeKeyword -> Nothing
  ST.DataTypeParams -> Nothing
  ST.DataTypeModifier -> Nothing
  ST.UseKeyword -> Just HiBlack
  ST.UsePrefix -> Just HiBlack
  ST.UseSuffix -> Just HiBlack
  ST.HashQualifier _ -> Just HiBlack
  ST.DelayForceChar -> Just Yellow
  ST.DelimiterChar -> Nothing
  ST.Parenthesis -> Nothing
  ST.DocDelimiter -> Just Green
  ST.DocKeyword -> Just Bold

@pchiusano pchiusano added help wanted papercut good first issue A good first issue for new contributors labels Dec 14, 2023
upendra1997 added a commit to upendra1997/unison that referenced this issue May 8, 2024
@aryairani aryairani added misc and removed help wanted good first issue A good first issue for new contributors papercut labels Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants