Skip to content

Update xterm for contrast ratio luminance change#149499

Merged
Tyriar merged 1 commit intomainfrom
tyriar/149495
May 16, 2022
Merged

Update xterm for contrast ratio luminance change#149499
Tyriar merged 1 commit intomainfrom
tyriar/149495

Conversation

@Tyriar
Copy link
Copy Markdown
Contributor

@Tyriar Tyriar commented May 13, 2022

Fixes #149495

image

@Tyriar Tyriar added this to the May 2022 milestone May 13, 2022
@Tyriar Tyriar requested a review from daviddossett May 13, 2022 20:07
@Tyriar Tyriar self-assigned this May 13, 2022
@daviddossett
Copy link
Copy Markdown
Collaborator

Thank you for taking this on! Is it possible to adjust the contrast ratio to match the editor for hc themes only? The text still has fairly low contrast.

I haven't looked at what's going on under the hood but my impression is that they should be the same.

CleanShot 2022-05-13 at 13 16 48@2x

CleanShot 2022-05-13 at 13 16 20@2x

@Tyriar
Copy link
Copy Markdown
Contributor Author

Tyriar commented May 13, 2022

@daviddossett this is by design as the terminal has the feature that lets you configure your contrast ratio, this comes wwith the bonus of retaining the hue (unless it gets inverted).

While doing this I was thinking maybe we should do something like if the user is using a high contrast theme and has not configured terminal.integrated.minimumContrastRatio then set it to 7, that could be confusing and not sure we've set that precedent yet. We could also do an explicit selection foreground color like the editor just for HC too.

@daviddossett
Copy link
Copy Markdown
Collaborator

daviddossett commented May 13, 2022

I think either makes sense, with perhaps a slight lean towards just setting the foreground color explitictly for consistency. I don't know if high contrast users will want or even need such fine control over contrast given the treatment of most text/code in those themes.

Another way of thinking about this would be like we do for preferred themes under dark/light/hc-dark/hc-light os settings. Something like:

"terminal.integrated.minimumContrastRatio": "4.5",
"terminal.integrated.minimumHighContrastRatio": "7"

...which adds complexity but at least removes the need for magic number changes after a theme change.

@Tyriar
Copy link
Copy Markdown
Contributor Author

Tyriar commented May 13, 2022

@daviddossett yeah I agree, let's track that in #149505 and xtermjs/xterm.js#3810

@Tyriar Tyriar requested a review from meganrogge May 16, 2022 16:15
@Tyriar Tyriar merged commit 1bbc5f2 into main May 16, 2022
@Tyriar Tyriar deleted the tyriar/149495 branch May 16, 2022 21:21
@jhpratt
Copy link
Copy Markdown

jhpratt commented May 21, 2022

I presume this PR is why the foreground text color changed in some situations? My terminal uses #55f (a pastel blue) as part of the prompt, which has always been black text, but now it's white. I actually find it harder to read.

Mingpan pushed a commit to Mingpan/vscode that referenced this pull request May 23, 2022
Update xterm for contrast ratio luminance change
@Tyriar
Copy link
Copy Markdown
Contributor Author

Tyriar commented May 23, 2022

@jhpratt while you may find it harder to read it should have a higher contrast ratio using standard relative luminance comparisons (correct me if I'm wrong). If this bothers you I suggest either reducing terminal.integrated.minimumContrastRatio a little or setting it to 1.

@jhpratt
Copy link
Copy Markdown

jhpratt commented May 23, 2022

Ah, it's configurable? Cool. I'll give that a shot when I'm on my laptop.

And by the way, I have no doubt that the contrast ratio is better. It's just an observation on my end that it doesn't appear better.

@Tyriar
Copy link
Copy Markdown
Contributor Author

Tyriar commented May 23, 2022

@jhpratt thanks for the feedback, my main point was I think that generally people would have an easier time since we're using contrast ratio.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow terminal minimum contrast ratio setting to change luminance the other way

4 participants