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:
but the color on iphone is:
the problem cames with ALL the colors, every time. Why?
2
Answers
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.
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 toNO
.See the UINavigationBar documentation.