Change AdjustIndistinguishableColors to an enum setting instead of a boolean setting#13512
Change AdjustIndistinguishableColors to an enum setting instead of a boolean setting#1351213 commits merged intomainfrom
Conversation
src/cascadia/TerminalSettingsEditor/Resources/en-US/Resources.resw
Outdated
Show resolved
Hide resolved
| // default color pairs within the color table | ||
| if (Feature_AdjustIndistinguishableText::IsEnabled() && | ||
| GetRenderMode(Mode::DistinguishableColors) && | ||
| GetRenderMode(Mode::IndexedDistinguishableColors) && |
There was a problem hiding this comment.
Shouldn't this be...
(GetRenderMode(Mode::IndexedDistinguishableColors) || GetRenderMode(Mode::IndexedDistinguishableColors)) &&There was a problem hiding this comment.
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.
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.
| _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.
Yea I'm curious about this too
There was a problem hiding this comment.
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/TerminalSettingsModel/TerminalSettingsSerializationHelpers.h
Show resolved
Hide resolved
|
And don't forget to update the schema/docs plz |
Co-authored-by: Carlos Zamora <[email protected]>
|
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
AdjustIndistinguishableColorscan 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,
trueandfalsemap toIndexedandNeverrespectivelyValidation Steps Performed
Setting still works