[Epic] Improved High Contrast support #17362

Open
opened 2026-01-31 05:40:17 +00:00 by claunia · 2 comments
Owner

Originally created by @zadjii-msft on GitHub (Apr 29, 2022).

Originally assigned to: @PankajBhojwani on GitHub.

written and maintained by @carlos-zamora
High contrast mode is something that Windows Terminal can just be smarter about. Here's a few ideas and relevant issues for this discussion...

Features

Other relevant issues

High Contrast-specific

High Contrast-adjacent

Originally created by @zadjii-msft on GitHub (Apr 29, 2022). Originally assigned to: @PankajBhojwani on GitHub. _written and maintained by @carlos-zamora_ High contrast mode is something that Windows Terminal can just be smarter about. Here's a few ideas and relevant issues for this discussion... ## Features - [ ] #3066 - [ ] #14940 - [x] Color scheme should leverage Delta E algorithm from #11095 to improve contrast - [ ] Transparency should automatically be disabled ## Other relevant issues ### High Contrast-specific - [x] #13070 - [x] #13069 - [x] #13068 - [x] #13067 - [x] #13065 - [x] #11257 ### High Contrast-adjacent - #3327 - #7118 - #15452 (and related #19433)
Author
Owner

@carlos-zamora commented on GitHub (Oct 27, 2022):

There's been some discussion regarding enabling adjustIndistinguishableColors automatically when high contrast mode is enabled. Here's a relevant excerpt from an internal email thread:

Thanks for reaching out. Before we get further, let me caveat that I’m not the official accessibility champ here; I’m more an unofficial champ.

I think your plan of increasing the delta E threshold makes a lot of sense to me. High Contrast mode is first about being merely legible, and second about being beautiful, so I don’t think “quite strange” color combinations is a deal-breaker. If hot pink on navy blue is legible, then HC customers won’t complain about your poor taste 😉.

I’ll caveat that by saying that this isn’t at all how win32 apps work. In win32, when HC mode is enabled, the user selects a high contrast theme, which sets 4 colors: {foreground, background, highlight, alternate-highlight}. Ideally, the terminal would play along with win32 and also reduce everything to those 4 colors. But I can imagine that it would be difficult to classify arbitrary text into those 4 buckets, if the console application is itself setting a bunch of colors all over the place, and not giving you any metadata on “foreground” or “highlight”.

Like you and unlike win32, Edge is also playing the game of recoloring uncooperative websites. Its strategy is a little different from yours. Edge will delete most background images, force all background colors to the OS theme HC background color, force all text to the OS theme HC foreground color, and force all hyperlinks to the OS theme HC highlight color. I don’t know if a strategy like that would be useful with terminal apps. I’d say that Edge’s heuristics are about 95% successful, but there are still websites that Edge simply makes worse (e.g., it deletes a background image that was critical to understanding the website).

If you want to go further down this path, maybe you could invent some VT codes to inform well-meaning terminal apps about the HC theme, and allow them to opt-in to doing the right thing? (I imagine that pwsh.exe would be the only app ever to use these VT codes, but still having your shell adapt to your needs is a very good step.)

tldr:

  • Delta E can be used to solve the high contrast issue
  • Ideally, we'd respect the contrast theme in the Windows setting. This operates by representing all colors to the 4/5 theme colors
  • Edge approaches this differently by forcing everything to the contrast theme colors. We could try and do the same for Terminal.
  • Consider creating a VT sequence to inform the app of a the high contrast theme

My thoughts on the matter:

  • On one hand, I think we should match the OS contrast theme.
    • I like Edge's method of accomplishing this. Perhaps a heuristic we could use is something like, foreground and background map directly to HC.Foreground and HC.Background from the contrast theme. Hyperlinks and formatted text map to HC.highlight. Custom color overrides map to HC.alternate-highlight.
    • Personally, don't understand why a VT sequence would be needed for this? Curious how it differs and interacts with the one mentioned in #3066. This is just a lack of understanding on my part, don't mean anything by it haha.
  • On the other hand, WT allows users to apply different color schemes based on their session/profile, so adjustIndistinguishableColors + profile.colorScheme is a pretty cool way to provide that customizability to users.
@carlos-zamora commented on GitHub (Oct 27, 2022): There's been some discussion regarding enabling `adjustIndistinguishableColors` automatically when high contrast mode is enabled. Here's a relevant excerpt from an internal email thread: > Thanks for reaching out. Before we get further, let me caveat that I’m not the official accessibility champ here; I’m more an unofficial champ. > > I think your plan of increasing the delta E threshold makes a lot of sense to me. High Contrast mode is first about being merely legible, and second about being beautiful, so I don’t think “quite strange” color combinations is a deal-breaker. If hot pink on navy blue is legible, then HC customers won’t complain about your poor taste 😉. > > I’ll caveat that by saying that this isn’t at all how win32 apps work. In win32, when HC mode is enabled, the user selects a high contrast theme, which sets 4 colors: {foreground, background, highlight, alternate-highlight}. Ideally, the terminal would play along with win32 and also reduce everything to those 4 colors. But I can imagine that it would be difficult to classify arbitrary text into those 4 buckets, if the console application is itself setting a bunch of colors all over the place, and not giving you any metadata on “foreground” or “highlight”. > > Like you and unlike win32, Edge is also playing the game of recoloring uncooperative websites. Its strategy is a little different from yours. Edge will delete most background images, force all background colors to the OS theme HC background color, force all text to the OS theme HC foreground color, and force all hyperlinks to the OS theme HC highlight color. I don’t know if a strategy like that would be useful with terminal apps. I’d say that Edge’s heuristics are about 95% successful, but there are still websites that Edge simply makes worse (e.g., it deletes a background image that was critical to understanding the website). > > If you want to go further down this path, maybe you could invent some VT codes to inform well-meaning terminal apps about the HC theme, and allow them to opt-in to doing the right thing? (I imagine that pwsh.exe would be the only app ever to use these VT codes, but still having your shell adapt to your needs is a very good step.) tldr: - Delta E can be used to solve the high contrast issue - Ideally, we'd respect the contrast theme in the Windows setting. This operates by representing all colors to the 4/5 theme colors - Edge approaches this differently by forcing everything to the contrast theme colors. We could try and do the same for Terminal. - Consider creating a VT sequence to inform the app of a the high contrast theme My thoughts on the matter: - On one hand, I think we should match the OS contrast theme. - I like Edge's method of accomplishing this. Perhaps a heuristic we could use is something like, foreground and background map directly to HC.Foreground and HC.Background from the contrast theme. Hyperlinks and formatted text map to HC.highlight. Custom color overrides map to HC.alternate-highlight. - Personally, don't understand why a VT sequence would be needed for this? Curious how it differs and interacts with the one mentioned in #3066. This is just a lack of understanding on my part, don't mean anything by it haha. - On the other hand, WT allows users to apply different color schemes based on their session/profile, so `adjustIndistinguishableColors` + `profile.colorScheme` is a pretty cool way to provide that customizability to users.
Author
Owner

@carlos-zamora commented on GitHub (Feb 26, 2024):

This seems helpful: https://learn.microsoft.com/en-us/windows/apps/design/accessibility/high-contrast-themes

@carlos-zamora commented on GitHub (Feb 26, 2024): This seems helpful: https://learn.microsoft.com/en-us/windows/apps/design/accessibility/high-contrast-themes
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17362