Bug 1247373 - Correctly handle colors from named color spaces in the native color picker. r=mstange
authorDaniel Glazman <daniel@glazman.org>
Tue, 09 Aug 2016 15:12:57 -0400
changeset 308855 bd03c5af655d4fcd00c6764be4e4d92ff74efcd3
parent 308854 36765ad4e9d47e34bffd4c42c75328cd951247f5
child 308856 b31cd488ed6e741c78cf40d97e08b31f560449cd
push id20279
push usercbook@mozilla.com
push dateWed, 10 Aug 2016 14:04:43 +0000
treeherderfx-team@531100c1d950 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1247373
milestone51.0a1
Bug 1247373 - Correctly handle colors from named color spaces in the native color picker. r=mstange MozReview-Commit-ID: LEajtxr3vx6
widget/cocoa/nsColorPicker.mm
--- a/widget/cocoa/nsColorPicker.mm
+++ b/widget/cocoa/nsColorPicker.mm
@@ -157,16 +157,20 @@ nsColorPicker::Open(nsIColorPickerShownC
   NS_ADDREF_THIS();
 
   return NS_OK;
 }
 
 void
 nsColorPicker::Update(NSColor* aColor)
 {
+  NSColor *color = aColor;
+  if ([[aColor colorSpaceName] isEqualToString:NSNamedColorSpace]) {
+    color = [aColor colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]];
+  }
   GetHexStringFromNSColor(aColor, mColor);
   mCallback->Update(mColor);
 }
 
 void
 nsColorPicker::DoneWithRetarget()
 {
   mCallback->Done(EmptyString());