-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Implement Delta E 2000 to correct color perception #2638
Comments
It looks to me like it's cmder that might be getting the color wrong. I suggest you try out those color values in an HTML document with a little test like this:
As far as I can tell, that produces colors that exactly match what the Windows Terminal is showing. |
It looks like ConEmu does some cool stuff to make sure that a color can always be perceived. It bumps colors that could be invisible on a certain background up in perceptibility using the deltaE 2000 algorithm. |
It looks like ConEmu lets you configure that with its "Adjust lightness of indistinguishable text" option. I'm betting that if you turn it off, you'll see the same colors as in WT. |
@DHowett fair enough! Should I then open a new issue to feature request the same in terminal or can we convert this one? |
It would be pretty cool if we could do the same for Terminal. I had wondered why color output looked a bit different. Thanks for breaking it down @DHowett . |
What would be needed/considered to implement this in Terminal? |
All it would need is someone to do the work, and two people to review the pull request. 😄 I'd prefer to see a specification to answer a couple questions: would this happen during rendering? Color scheme loading? Is there somewhere we could, should cache colors? How do we hook this setting up into the layer it needs to go into? Should we nudge rgb or 256-color entries the same way as user-specified ones? |
Three very easy things 😅 I can't answer any of the specifics regarding how this or WT actually work. This would only pertain to foreground/background compatibility right? But I would happy be with just user-specified colors. Nudging 256 color entries would be nice if it wasn't much more overhead, and was cached ahead of time. But looking beyond the scope of user-specified colors might cause this fix to grow too much. For example, opacity or background images would mess up these adjustments, so I don't think that should be supported/fixed. |
@CIPop I've been quite successfully using my patched version of
As compared to the built-in Solarized, it never produces any unreadable results and has decent difference between colors. |
@kojoru I suggest sending a PR updating the default with this instead. |
Fair enough! Will do. |
This may help for anyone trying to implement this: http://www.easyrgb.com/en/math.php#text6. I got this website from the answer in https://stackoverflow.com/questions/5774152/calculate-how-humans-perceive-similarity-between-different-colours. We use chromium math functions in C++ so it just needs conversion to use that instead. |
Based on the discussion in microsoft#2638 until the Delta E 2000 contrast algo is implemented in Terminal, it would be great to have a Solarized Dark color scheme that does actually have enough contrast to be realistically used for powershell. This color scheme is based on "Solarized (John Doe)" from ConEmu and modified to have a more visible `DarkBlue` as also discussed in microsoft#2638
- Implements the Delta E algorithm - Uses the Delta E algorithm to precalculate adjusted foreground values based on possible foreground/background color pairs in the color table - Adds a setting to use the adjusted foreground values when applicable ## PR Checklist * [x] Closes #2638 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [ ] Schema updated. * [x] I work here ## Validation Steps Performed Before: <img width="759" alt="color before" src="https://user-images.githubusercontent.com/26824113/131576768-b3b9eebd-5933-45de-8da8-88a985070312.png"> After (note dark blue): <img width="760" alt="color after" src="https://user-images.githubusercontent.com/26824113/133158807-4e63198f-8a49-4d03-914e-55a5ad57d725.png">
🎉This issue was addressed in #11095, which has now been successfully released as Handy links: |
Environment
Steps to reproduce
[enum]::GetValues([System.ConsoleColor]) | Foreach-Object {Write-Host $_ -ForegroundColor $_}
to admire the colorsExpected behavior
Colors look as nice as ConEmu's
Actual behavior
Most colors look nice and similar but "DarkBlue" looks completely different and way worse. See screenshot.
To get a somewhat similar color you need to set blue (DarkBlue) to something like
"blue" : "#0B5669"
The text was updated successfully, but these errors were encountered: