Wrong color in Interface Builder's color picker

Nicu Surdu picture Nicu Surdu · Oct 2, 2012 · Viewed 14.1k times · Source

I have an UIImageView with a brown image that will not always reach the top part. The UIImage view is inside a white UIView.

So, because the top part of the image is a linear brown color, I said I will make the UIView underneath it the same brown color, and the user will not see where the image ends. So far, so good.

My problem is, when I pick the color in the top part of the image, the color picker picks a more darker color than actually is there :(

Before I click the color picker: enter image description here

After I click the color picker: enter image description here

How comes ?

Answer

Zack Morris picture Zack Morris · Dec 4, 2014

Just wanted to elaborate upon the accepted answer with some screenshots.

If you want to match RGB values between Photoshop and Xcode exactly (without conversion between colorspaces) then you need to save your images in generic RGB and enter any dropper values using the generic RGB colorspace.

  • When you choose "Save for Web & Devices" from Photoshop, uncheck the "Convert to sRGB" box.

enter image description here

  • In Xcode, click the colorspace popup in the color picker and choose "Generic RGB", then enter the red, green and blue values from Photoshop, NOT THE HEX VALUE as this reverts back to the sRGB colorspace for some reason (be careful not to tab to the hex field either, as that also changes the colorspace to sRGB).

enter image description here

More info here, including how to match screenshots.