Skip to content

Implement Delta E 2000 to correct color perception #2638

Closed

Description

Environment

Windows build number:  10.0.18362.0
Windows Terminal version : 0.4.2382.0
ConEmu version: 180626 

Steps to reproduce

  1. Copy the color palette for "<Solarized (John Doe)>" from ConEmu to terminal. Here's the relevant JSON:
        {   
            "white" : "#fdf6e3",
            "blue" : "#073642",
            "green" : "#586e75",
            "cyan" : "#657b83",
            "red" : "#dc322f",
            "purple" : "#6c71c4",
            "yellow" : "#cb4b16",
            "brightWhite" : "#eee8d5",
            "brightBlack" : "#93a1a1",
            "brightBlue" : "#268bd2",
            "brightGreen" : "#859900",
            "brightCyan" : "#2aa198",
            "brightRed" : "#839496",
            "brightPurple" : "#d33682",
            "brightYellow" : "#b58900",
            "black" : "#002B36",
            "background" : "#002B36",
            "foreground" : "#fdf6e3",
            "name" : "Solarized (John Doe)"
        }
  1. Set powershell's color scheme to "Solarized (John Doe)"
  2. Run [enum]::GetValues([System.ConsoleColor]) | Foreach-Object {Write-Host $_ -ForegroundColor $_} to admire the colors

Expected 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.
image

To get a somewhat similar color you need to set blue (DarkBlue) to something like "blue" : "#0B5669"
image

Activity

  1. ghost added
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Sep 2, 2019
  2. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Sep 2, 2019
  3. j4james commented on Sep 2, 2019

    @j4james
    Collaborator

    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:

    <body style="background:#002b36">
    <div style="color:#073642">DarkBlue</div>
    <div style="color:#586e75">DarkGreen</div>
    <div style="color:#657b83">DarkCyan</div>
    <div style="color:#dc322f">DarkRed</div>
    <div style="color:#6c71c4">DarkMagenta</div>
    </body>
    

    As far as I can tell, that produces colors that exactly match what the Windows Terminal is showing.

  4. DHowett-MSFT commented on Sep 3, 2019

    @DHowett-MSFT
    Contributor

    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.

  5. DHowett-MSFT commented on Sep 3, 2019

    @DHowett-MSFT
    Contributor

    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.

  6. kojoru commented on Sep 3, 2019

    @kojoru
    ContributorAuthor

    Dustin L. Howett (@DHowett) fair enough! Should I then open a new issue to feature request the same in terminal or can we convert this one?

  7. WSLUser commented on Sep 3, 2019

    @WSLUser
    Contributor

    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 Dustin L. Howett (@DHowett) .

  8. changed the title [-]Unexpected color output compared to Cmder/ConEmu[/-] [+]Implement Delta E 101 to correct color perception[/+] on Sep 9, 2019
  9. removed
    Needs-Tag-FixDoesn't match tag requirements
    Needs-TriageIt's a new issue that the core contributor team needs to triage at the next triage meeting
    on Sep 9, 2019
  10. ghost added
    Needs-Tag-FixDoesn't match tag requirements
    on Sep 9, 2019
  11. added
    Issue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.
    Area-RenderingText rendering, emoji, complex glyph & font-fallback issues
    on Sep 9, 2019
  12. 3 remaining items

  13. DHowett commented on May 22, 2020

    @DHowett
    Member

    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?

  14. hectormz commented on May 22, 2020

    @hectormz

    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.

  15. CIPop commented on Jun 10, 2020

    @CIPop

    +1 on this. To avoid others wasting their time:

    Solarized Dark is not supported on Terminal today (assuming that most people like to see what they are typing).
    Dustin L. Howett (@DHowett) was kind enough to suggest workarounds in #6424 if you're hitting these issues.

  16. changed the title [-]Implement Delta E 101 to correct color perception[/-] [+]Implement Delta E 2000 to correct color perception[/+] on Jun 10, 2020
  17. kojoru commented on Jun 12, 2020

    @kojoru
    ContributorAuthor

    Cristian Pop (@CIPop) I've been quite successfully using my patched version of Solarized (John Doe) snatched from ConEmu ever since I filed this issue. It goes as follows:

            {   
                "white" : "#fdf6e3",
                "blue" : "#0B5669",
                "green" : "#586e75",
                "cyan" : "#657b83",
                "red" : "#dc322f",
                "purple" : "#6c71c4",
                "yellow" : "#cb4b16",
                "brightWhite" : "#eee8d5",
                "brightBlack" : "#93a1a1",
                "brightBlue" : "#268bd2",
                "brightGreen" : "#859900",
                "brightCyan" : "#2aa198",
                "brightRed" : "#839496",
                "brightPurple" : "#d33682",
                "brightYellow" : "#b58900",
                "black" : "#002B36",
                "background" : "#002B36",
                "foreground" : "#fdf6e3",
                "name" : "Solarized (John Doe with contrast blue)"
            }
    

    As compared to the built-in Solarized, it never produces any unreadable results and has decent difference between colors.
    image

  18. WSLUser commented on Jun 12, 2020

    @WSLUser
    Contributor

    Konstantin Yakushev (@kojoru) I suggest sending a PR updating the default with this instead.

  19. kojoru commented on Jun 12, 2020

    @kojoru
    ContributorAuthor

    Fair enough! Will do.

  20. WSLUser commented on Jun 12, 2020

    @WSLUser
    Contributor

    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.

  21. ghost added
    In-PRThis issue has a related PR
    on Aug 31, 2021
  22. ghost closed this as completedin #11095on Oct 7, 2021
  23. ghost removed
    In-PRThis issue has a related PR
    on Oct 7, 2021
  24. ghost added a commit that references this issue on Oct 7, 2021
    dd5dbb2
  25. ghost added
    Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.
    on Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-AccessibilityIssues related to accessibilityArea-RenderingText rendering, emoji, complex glyph & font-fallback issuesIssue-FeatureComplex enough to require an in depth planning process and actual budgeted, scheduled work.Product-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions