Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: ui/gfx/color_utils.cc

Issue 1977693004: [MD] Adjust algorithm for colorizing icons in incognito contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static cast Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_utils.cc
diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc
index a4618f27e66f5e383e0d175dba9e2cf7b7b4e6be..d64a8b3636059cf5c79c714ff39e0983d2ddba9d 100644
--- a/ui/gfx/color_utils.cc
+++ b/ui/gfx/color_utils.cc
@@ -328,15 +328,15 @@ bool IsInvertedColorScheme() {
#endif // !defined(OS_WIN)
SkColor DeriveDefaultIconColor(SkColor text_color) {
- // This function works similarly to BlendTowardOppositeLuminance, but uses a
- // different blend value for lightening and darkening.
+ // Lighten a dark color but leave it fully opaque.
if (IsDark(text_color)) {
// For black text, this comes out to kChromeIconGrey.
return color_utils::AlphaBlend(SK_ColorWHITE, text_color,
SkColorGetR(gfx::kChromeIconGrey));
}
- // The dimming is less dramatic when darkening a light color.
- return color_utils::AlphaBlend(SK_ColorBLACK, text_color, 0x33);
+ // For a light color, just reduce opacity.
+ return SkColorSetA(text_color,
+ static_cast<int>(0.8f * SkColorGetA(text_color)));
}
} // namespace color_utils
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698