In iOS7
, the UIColor
you set is not the same color that will be displayed on screen. Instead, iOS
will adjust your RGB
values a bit and use those as the color.
To calculate the color with white background behind the bar, you should use these formulas as explained in Bar Color Calculator :
Going from designs to UIColor
:
(n – 102) / 0.6
Going from UIColor
to designs:
(255 – n) / 2.5 + n
where n is the R, G or B 0-255 value.
So, what you are getting using the ColorPicker
or from some similar app is not the values you should use for R, G and B. But those are the values calculated by the iOS from some other RGB values. To get the exact value, you should follow these steps.
- Get the values of R, G and B using ColorPicker for the Facebook Navigation Bar.
Use those values in above formulas to calculate the exact value.
For Eg: R_fromFB = (R – 102) / 0.6
So, R = (0.6 * R_fromFB) + 102
Use these R, G and B values in your Navigation Bar.
For Example, you can try with this color :
[UIColor colorWithRed:(135/255.0) green:(153/255.0) blue:(189/255.0) alpha:1]