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

Issue with selectionBackground color #17355

Closed
steakhutzeee opened this issue Jun 3, 2024 · 2 comments
Closed

Issue with selectionBackground color #17355

steakhutzeee opened this issue Jun 3, 2024 · 2 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@steakhutzeee
Copy link

Windows Terminal version

1.19.11213.0

Windows build number

10.0.22621.0

Other Software

N/A

Steps to reproduce

Applied the following theme:

https://github.com/folke/tokyonight.nvim/blob/main/extras/windows_terminal/tokyonight_night.json

{
    "background": "#1a1b26",
    "black": "#15161e",
    "blue": "#7aa2f7",
    "brightBlack": "#414868",
    "brightBlue": "#7aa2f7",
    "brightCyan": "#7dcfff",
    "brightGreen": "#9ece6a",
    "brightPurple": "#9d7cd8",
    "brightRed": "#f7768e",
    "brightWhite": "#c0caf5",
    "brightYellow": "#e0af68",
    "cursorColor": "#c0caf5",
    "cyan": "#7dcfff",
    "foreground": "#c0caf5",
    "green": "#9ece6a",
    "name": "Tokyo Night",
    "purple": "#bb9af7",
    "red": "#f7768e",
    "selectionBackground": "#283457",
    "white": "#a9b1d6",
    "yellow": "#e0af68"
}

but I'm experiencing an issue with the selectionBackground color.

As you can see from the screenshot it actually changes to a different color code, different from #283457

color

If I use a picker I see that it's set to #21273F instead.

Any hints why this happens?

Thank you!

Expected Behavior

selectionBackground set to 283457 .

Actual Behavior

selectionBackground is set to 21273F instead.

@steakhutzeee steakhutzeee added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 3, 2024
@DHowett
Copy link
Member

DHowett commented Jun 3, 2024

Unfortunately, yes, selectionBackground is blended at 50% opacity with the contents of the terminal. This will result in some differences depending on what is being displayed.

We're tracking making this better in /dup #3561 -- though don't let the exact title fool you, it means "do selection colors better"

@microsoft-github-policy-service microsoft-github-policy-service bot added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 3, 2024
@steakhutzeee
Copy link
Author

Unfortunately, yes, selectionBackground is blended at 50% opacity with the contents of the terminal. This will result in some differences depending on what is being displayed.

We're tracking making this better in /dup #3561 -- though don't let the exact title fool you, it means "do selection colors better"

Thank you for the quick feedback!

DHowett added a commit that referenced this issue Aug 19, 2024
…a overlay (#17725)

With the merge of #17638, selections are now accumulated early in the
rendering process. This allows Atlas, which currently makes decisions
about cell foreground/background at the time of text rendering,
awareness of the selection ranges *before* text rendering begins.

As a result, we can now paint the selection into the background and
foreground bitmaps. We no longer need to overlay a rectangle, or series
of rectangles, on top of the rendering surface and alpha blend the
selection color onto the final image.

As a reminder, "alpha selection" was always a stopgap because we didn't
have durable per-cell foreground and background customization in the
original DxEngine.

Selection foregrounds are not customizable, and will be chosen using the
same color distancing algorithm as the cursor. We can make them
customizable "easily" (once we figure out the schema for it) for #3580.

`ATLAS_DEBUG_SHOW_DIRTY` was using the `Selection` shading type to draw
colored regions. I didn't want to break that, so I elected to rename the
`Selection` shading type to `FilledRect` and keep its value. It helps
that the shader didn't have any special treatment for
`SHADING_TYPE_SELECTION`.

This fixes the entire category of issues created by selection being an
80%-opacity white rectangle. However, given that it changes the imputed
colors of the text it will reveal `SGR 8` concealed/hidden characters.

Refs #17355
Refs #14859
Refs #11181
Refs #8716
Refs #4971
Closes #3561
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants