skip to Main Content

My designers asks me to show a UIView with a Photoshop’s RGB of 125, 178, 60. So I set the color as in the code below:

+ (UIColor *) okThronColor {

    return [UIColor colorWithRed:(CGFloat)(125.0/255.0)
                           green:(CGFloat)(178.0/255.0)
                            blue:(CGFloat)(60.0/255.0) 
                           alpha:1];

}

Photoshop says me that the color is:
enter image description here

but the color on iphone is:

enter image description here

the problem cames with ALL the colors, every time. Why?

2

Answers


  1. I believe this comes down to colour profiles. If you are using Photoshop, if I remember correctly this is defaulted to a colour profile that is best suited to photo’s. Most dynamic range etc. Whereas the system will use as low a colour profile as possible because it is less of a memory footprint.

    This article here, suggests some methods to get around it to get the correct RGB values for iOS, with a bit more of an insight into why this is probably happening.

    Login or Signup to reply.
  2. In iOS 7 (and above) the navigation bar is translucent, and the color is affected by whatever lays behind it.

    Try setting the translucent property to NO.

    See the UINavigationBar documentation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search