Interface Builder Woes

For my big sweat equity project that I am working on I get graphics from a graphic artist to use in the application.  But sometimes I need to create a background that matches the color of an image I have received.

Color DialogIt sounds easy and it should be easy.  I do not know if some setting of mine has been messed up or if  this has always been the case, but the colors in Interface Builder do not match the colors in the final application.  I even went back to some of the very first applications that I created and checked with DigitalColor Meter a neat application for returning the color under the mouse pointer.

The first thing I noticed is that the images once dropped into interface builder seem to be a bit darker.  To change the color of an item you click on the color swatch to open the color dialog box.  Now to match a color all you need to do is click on the magnifying glass and you can now use the magnifying glass to choose the color of any item on your desktop.  The first thing I tried was to naturally click on the graphic that I wanted to match in IB.  No go!  A recompile and then a view in simulator and the colors do not match.  I then open the graphics in preview as that displayed the image correctly.  I tried the color match again with the magnifying glass and still no match.  After trying many different things I noticed that when you use the rgb sliders you have the option to change the color space.  After selecting the matching color with the magnify glass the color space is set to “device RGB”.

I changed it to “generic RGB” and the slider values changed, but the color swatch remained the same color.  The next trick is to write down the color values when “device RGB” is selected and transfer those values to when “generic RGB” is selected.  When you make the change the color will not match in IB, but match in the final product.  I think I need to find out more about this problem.  I should not have to jump through these hoops.  Hopefully it is something simple.

Comments (2)

2 Responses to “Interface Builder Woes”

  1. Mark Johnson says:

    Yes, useful. I am battling this problem too. I have to set some colors in IB, and some in code, and they are not matching! Thanks

  2. Brian Hsieh says:

    This was really helpful. I followed your cue and switched the RGB box to RGB Generic, then entered in the RGB 8-bit values obtained from DigitalColor Meter (Applications –> Utilities). It finally worked!

Leave a Reply

Powered by WordPress