In my storyboard, I see some colors with a colorSpace
of deviceRGB
and I see others with a color space of calibratedRGB
. I've never specified colors to use either of these, it's just magically set. The thing is, it seems random which color is specified with which.
What's the difference?
How does Interface Builder know which to use?
<color key="backgroundColor" red="1" green="0.75" blue="0.75" alpha="1" colorSpace="deviceRGB"/>
versus
<color key="backgroundColor" red="1" green="0.75" blue="0.75" alpha="1" colorSpace="calibratedRGB"/>
Color space refers to ways of matching colors between or within devices.
Every device - phones, printers, scanners, computers, whatever - shows color in its own way. The device's method of displaying the color would be referenced by Apple's "device" color space.
If you have ever used software, that came with a printer or scanner perhaps, which asked you to "calibrate" your monitor, say, that software would be attempting to use a "calibrated" color space - a method of ensuring that colors appear exactly the same regardless of device used. (In this case, the software would be attempting to ensure that your printer or scanner's output would correctly match what you see on your computer's screen when you're using the software.)
I can't really answer at this point why Apple would be setting one or the other in different places, but these documents might help:
Apple Developer doc explaining color overall, including color spaces and issues related to color matching. (This is old - July 2005 last update - but is still referenced in other Apple docs.)
Color Management Overview
A current Apple Developer doc (last updated December 2013) regarding color specifics for iOS development. (There is a specific section called "Color and Color Spaces".)
Quartz 2D Programming Guide
And, finally, Apple's class reference for CGColorSpace (last updated August 2013). It gives a quick summary of color and color spaces before continuing on into the class specifics.
CGColorSpace Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With