Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird colors in XCode Interface Builder?

Tags:

I have really weird problem with colors in interface builder. I set a color on one UI element, for example UIView, and then I want the same color on UIButton...but when I try to do so, colors are often different - I mean little bit different tone, not absolutely different color. How is this even possible ??? I've tried to use RGB sliders, and other sliders, also that color picker tool... Only thing that helps me sometimes is, when I create new UI element. Anybody had the same problem and knows what's going on ?

like image 300
Michael Avatar asked Sep 20 '11 16:09

Michael


People also ask

How do I add custom colors to Xcode project?

To create a color from our palette, we can do it directly by selecting the Assets. xcassets folder (or creating our own . xcassets folder for colors) in the project navigator (Project Navigator). Then we right click and select New Color Set.

How do I add a color palette in Xcode?

In the Interface Builder's color dialog, choose the third tab. Click the gear and New to make a new custom color palette. You can name it whatever you want. Then click the plus (+) button to add a new color and name it.


2 Answers

Interface Builder filters colors through your monitor's current color space by default. You can change this in Xcode4 IB by bringing up a Colors dialog, clicking the Sliders tab, then clicking the little dropdown button under the magnifying glass that looks like a color spectrum. This will bring up a list of available color spaces -- select Generic RGB and adjust the sliders as necessary to get the correct color.

See this question for more information, especially the comments on the accepted answer.

like image 140
dvs Avatar answered Sep 19 '22 00:09

dvs


I solved this issue using "Device RGB" instead "Generic RGB". See the image: enter image description here

like image 38
Scinfu Avatar answered Sep 21 '22 00:09

Scinfu