Question

I was trying to sample the default colors used by Reminders app in iOS7 and use them in my app.

What I do is to use the DigitalColor Meter (in Generic RGB mode) to sample the RGB value, then I put this value in my app to construct a UIColor. Then I tweak this value until the DigitalColor Meter gives me the same set of RGB value as it gives me for the iOS7 Reminders app.

However, it seems like I cannot reconstruct some of the colors by using UIColor. For example, when reconstructing the blue color, I already have 0 for the R value in my UIColor, yet the DigitalColor Meter does not give me a value smaller than 36, which is still bigger than the value of 30 for the R value of the blue color in the Reminders app.

enter image description here

Does UIColor not cover the entire gamut of colors? Does Apple use some special hidden API to a wider range of colors?

Was it helpful?

Solution

I'm not entirely sure what the problem is here. I took a screenshot of the Reminders app, and measured the blue color as 26, 173, 248 in Decimal mode. Then I went to my app's storyboard and set the view background color to 26, 173, 248 using the sliders. I ran my app on the phone and took a screenshot of it. Digital Color Meter reads 26/173/248 on my app as I would expect.

If you're using UIColor, you can use Percentage mode on Digital Color Meter to give you the correct values. For me, that blue color reads as 10%, 68%, 97%, so I used this code:

[UIColor colorWithRed:.1f green:.68f blue:.97f alpha:1];

I set that as my view background color in code, and running it I can't see any difference between it and the label background I set using the sliders on the storyboard.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top