Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong color in Interface Builder's color picker

Tags:

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 ?

like image 569
Nicu Surdu Avatar asked Oct 02 '12 07:10

Nicu Surdu


People also ask

How do you add color to a color picker?

To add a color picker in an HTML page, use an <input> tag with type = 'color' . The initial value can be set using the value property. This value needs to be set in hexadecimal because colors are represented as six-digit hexadecimal values following a hashtag ( # ).

How does a color picker work?

A color picker is used to select and adjust color values. In graphic design and image editing, users typically choose colors via an interface with a visual representation of a color—organized with quasi-perceptually-relevant hue, saturation and lightness dimensions (HSL) – instead of keying in alphanumeric text values.

How do I use color picker in Visual Studio?

Highlight colors in Visual Studio Document Editor, Choose between Underline or a Color Box from Tools->Options->Color Picker. N number of color formats are supported. Edit color using a click and convert to any format.


1 Answers

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.

like image 168
Zack Morris Avatar answered Feb 07 '23 03:02

Zack Morris