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

Change AdjustIndistinguishableColors to an enum setting instead of a boolean setting #13512

Merged
13 commits merged into from
Jul 22, 2022
20 changes: 16 additions & 4 deletions doc/cascadia/profiles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@
"type": "string"
},
"adjustIndistinguishableColors": {
"description": "When set to true, we will (when necessary) adjust the foreground color to make it more visible, based on the background color.",
"type": "boolean"
"default": "Never",
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
"description": "Setting to adjust the foreground color to make it more visible, based on the background color. When set to \"indexed\", we will only adjust the colors if they came from the color scheme. Other possible values are \"never\" and \"always\".",
"enum": [
"never",
"indexed",
"always"
],
"type": "string"
},
"experimental.retroTerminalEffect": {
"description": "When set to true, enable retro terminal effects when unfocused. This is an experimental feature, and its continued existence is not guaranteed.",
Expand Down Expand Up @@ -2276,8 +2282,14 @@
]
},
"adjustIndistinguishableColors": {
"description": "When set to true, we will (when necessary) adjust the foreground color to make it more visible, based on the background color.",
"type": "boolean"
"default": "Never",
zadjii-msft marked this conversation as resolved.
Show resolved Hide resolved
"description": "Setting to adjust the foreground color to make it more visible, based on the background color. When set to \"indexed\", we will only adjust the colors if they came from the color scheme. Other possible values are \"never\" and \"always\".",
"enum": [
"never",
"indexed",
"always"
],
"type": "string"
},
"scrollbarState": {
"default": "visible",
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/base/RenderSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ std::pair<COLORREF, COLORREF> RenderSettings::GetAttributeColors(const TextAttri
// We intentionally aren't _only_ checking for attr.IsInvisible here, because we also want to
// catch the cases where the fg was intentionally set to be the same as the bg. In either case,
// don't adjust the foreground.
if (fg != bg && GetRenderMode(Mode::AlwaysDistinguishableColors))
if (Feature_AdjustIndistinguishableText::IsEnabled() &&
fg != bg &&
GetRenderMode(Mode::AlwaysDistinguishableColors))
{
fg = ColorFix::GetPerceivableColor(fg, bg);
}
Expand Down