Chromium Code Reviews| Index: ui/gfx/color_utils.cc |
| diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc |
| index 978283d29ab7a326781548940c448c104a57201b..bea78b0916e00a6a676596c0b6fba5a38b4c6bec 100644 |
| --- a/ui/gfx/color_utils.cc |
| +++ b/ui/gfx/color_utils.cc |
| @@ -141,7 +141,8 @@ SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha) { |
| else if (lightness >= 1.0) |
| light = 255; |
| else |
| - light = static_cast<uint8_t>(SkDoubleToFixed(lightness) >> 8); |
| + // Scale from 0 - 255 and round off the value. |
| + light = static_cast<uint8_t>(lightness * 255 + .5); |
|
Peter Kasting
2016/02/18 23:54:03
Seems like we could replace this entire conditiona
dogben
2016/02/22 17:30:30
SGTM, thanks!
|
| return SkColorSetARGB(alpha, light, light, light); |
| } |