-
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
Changes from 9 commits
86a7133
d86700f
230c2aa
c4b0fb2
4c7c187
332f8b6
bde0937
da5116a
4be97c8
bd48da0
059e714
659feba
0acd810
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Shouldn't that be (GetRenderMode(Mode::IndexedDistinguishableColors) || GetRenderMode(Mode::AlwaysDistinguishableColors)) && There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block of code is for: " |
||
!dimFg && | ||
!attr.IsInvisible() && | ||
(fgTextColor.IsDefault() || fgTextColor.IsLegacy()) && | ||
|
@@ -252,6 +252,8 @@ std::pair<COLORREF, COLORREF> RenderSettings::GetAttributeColors(const TextAttri | |
fg = bg; | ||
} | ||
|
||
fg = GetRenderMode(Mode::AlwaysDistinguishableColors) ? ColorFix::GetPerceivableColor(fg, bg) : fg; | ||
PankajBhojwani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
return { fg, bg }; | ||
} | ||
} | ||
|
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.
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 isAlways
, since we don't even access the table and instead we calculate the adjusted foreground just before rendering (see line 255 in RenderSettings.cpp)