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

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: 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..a517b1dc1d4863cb161202763308b78bdba12315 100644
--- a/ui/gfx/color_utils.cc
+++ b/ui/gfx/color_utils.cc
@@ -328,15 +328,14 @@ 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 set an opacity.
+ return SkColorSetA(text_color, 0xCC);
sky 2016/05/13 19:29:34 Might test_color have an alpha < 0xCC?
Evan Stade 2016/05/13 21:20:44 yea, I guess text color can be non-opaque (theme-c
}
} // 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