Skip to content

Commit

Permalink
Bug 1516867 - Clamp selection color saturation between 0 and 255 in n…
Browse files Browse the repository at this point in the history
…sLookAndFeel.mm. r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D15500

--HG--
extra : rebase_source : 2f7ced5f752a87b7df61aa0756b9315ca264ecab
extra : amend_source : 5f0fb6dc3ca07d34fd2b160490a1ade9c5daa424
  • Loading branch information
nt1m committed Dec 30, 2018
1 parent 7728c15 commit b4b53b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion widget/cocoa/nsLookAndFeel.mm
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static nscolor GetColorFromNSColorWithAlpha(NSColor* aColor, float alpha)
if (sat > 0) {
// The color is not a shade of grey, restore the saturation taken away by
// the transparency.
sat = sat * factor;
sat = mozilla::clamped(sat * factor, 0, 255);
} else {
// The color is a shade of grey, find the value that looks equivalent
// on a white background with the given opacity.
Expand Down

0 comments on commit b4b53b1

Please sign in to comment.