Chromium Code Reviews| Index: ui/gfx/color_utils.cc |
| diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc |
| index a4618f27e66f5e383e0d175dba9e2cf7b7b4e6be..e96ecbc6b5bf790e4615b5bbf7f53d0f93fda17a 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 reduce opacity. |
| + return SkColorSetA(text_color, 0.8 * SkColorGetA(text_color)); |
|
Peter Kasting
2016/05/14 02:07:47
Nit: I would static_cast the second arg to avoid t
Evan Stade
2016/05/16 18:04:02
Done.
|
| } |
| } // namespace color_utils |