barfoon
barfoon

Reputation: 28187

Why does the same RGB value appear different between Interface Builder and Photoshop?

I have a UIImageView that I've pointed to a PNG who's background is RGB(240,240,240). I've then set the parent UIView's background to the same colour in Interface Builder.

You'll notice that they are slightly different. When I take a screenshot and re-examine, I see that the UIView's background in IB is not RGB(240,240,240), but RGB(236,236,236).

Why is this??

enter image description here

enter image description here enter image description here

Upvotes: 5

Views: 714

Answers (3)

jlukanta
jlukanta

Reputation: 169

RGB value is meaningless without knowing the colorspace. Make sure you choose "Generic RGB" colorspace when selecting the color using the RGB sliders in Interface Builder.

Upvotes: 0

Raymond
Raymond

Reputation: 105

I had to tweak the numbers I used in IB to get my colors to match.

For example: You want (240,240,240) and it gives you (236,236,236) dispite that you entered (240,240,240).

I entered (244,244,244) and it gave me a color closer to (240,240,240). I figured if I entered 240 and it gave me 236, then I should add 4 to my original colour code.

I had to do this a couple of times to get the right number.

Not an elegant solution but worked for me.

Upvotes: 0

Dave Harding
Dave Harding

Reputation: 1390

Do you have a manufacturer specific monitor driver installed? Have a look at the monitor profile. Its probably different from the colour profile in photoshop

Upvotes: 1

Related Questions