-
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
Change AdjustIndistinguishableColors to an enum setting instead of a boolean setting #13512
Conversation
src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw
Outdated
Show resolved
Hide resolved
@@ -199,7 +199,7 @@ std::pair<COLORREF, COLORREF> RenderSettings::GetAttributeColors(const TextAttri | |||
// We want to nudge the foreground color to make it more perceivable only for the | |||
// default color pairs within the color table | |||
if (Feature_AdjustIndistinguishableText::IsEnabled() && | |||
GetRenderMode(Mode::DistinguishableColors) && | |||
GetRenderMode(Mode::IndexedDistinguishableColors) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be...
(GetRenderMode(Mode::IndexedDistinguishableColors) || GetRenderMode(Mode::IndexedDistinguishableColors)) &&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be...
(GetRenderMode(Mode::IndexedDistinguishableColors) || GetRenderMode(Mode::IndexedDistinguishableColors)) &&
Shouldn't that be
(GetRenderMode(Mode::IndexedDistinguishableColors) || GetRenderMode(Mode::AlwaysDistinguishableColors)) &&
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This block of code is for: "Indexed
was the mode chosen, so use our precalculated 'adjusted' color table to determine the foreground color", but we don't want to enter this block of code at all if the mode is Always
because in that case we just call the color adjustment function on whatever the final foreground is (see line 255)
_renderSettings.SetRenderMode(RenderSettings::Mode::IndexedDistinguishableColors, false); | ||
_renderSettings.SetRenderMode(RenderSettings::Mode::AlwaysDistinguishableColors, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_renderSettings.SetRenderMode(RenderSettings::Mode::IndexedDistinguishableColors, false); | |
_renderSettings.SetRenderMode(RenderSettings::Mode::AlwaysDistinguishableColors, true); | |
_renderSettings.SetRenderMode(RenderSettings::Mode::IndexedDistinguishableColors, true); | |
_renderSettings.SetRenderMode(RenderSettings::Mode::AlwaysDistinguishableColors, true); |
Should we just set both to true just to be safe? That way if someone in the future adds a feature to indexed, but forgets to check for "always", nothing will break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I'm curious about this too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I set this to false
for now is that we don't want to bother with creating the pre-calculated color table at all if the mode is Always
, since we don't even access the table and instead we calculate the adjusted foreground just before rendering (see line 255 in RenderSettings.cpp)
src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw
Outdated
Show resolved
Hide resolved
src/cascadia/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h
Outdated
Show resolved
Hide resolved
And don't forget to update the schema/docs plz |
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
Hello @zadjii-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
🎉 Handy links: |
Summary of the Pull Request
AdjustIndistinguishableColors
can now be set to:Never
: Never adjust the colorsIndexed
: Only adjust colors that are part of the color schemeAlways
: Always adjust the colorsReferences
#13343
PR Checklist
Detailed Description of the Pull Request / Additional comments
For legacy purposes,
true
andfalse
map toIndexed
andNever
respectivelyValidation Steps Performed
Setting still works