Detecting Color of iPhone/iPad/iPod touch? Detecting Color of iPhone/iPad/iPod touch? ios ios

Detecting Color of iPhone/iPad/iPod touch?


There's a private API to retrieve both the DeviceColor and the DeviceEnclosureColor.

UIDevice *device = [UIDevice currentDevice];SEL selector = NSSelectorFromString(@"deviceInfoForKey:");if (![device respondsToSelector:selector]) {    selector = NSSelectorFromString(@"_deviceInfoForKey:");}if ([device respondsToSelector:selector]) {    NSLog(@"DeviceColor: %@ DeviceEnclosureColor: %@", [device performSelector:selector withObject:@"DeviceColor"], [device performSelector:selector withObject:@"DeviceEnclosureColor"]);}

I've blogged about this and provide a sample app:

http://www.futuretap.com/blog/device-colors/

Warning: As mentioned, this is a private API. Don't use this in App Store builds.


The answer to the question is NO (as of now) and personally I don't think it's worth much, because what if the end-user uses a skin or an additional casing for his iPhone?

I'd suggest to initially ask the user "Hey, what's the color of your phone?" and then do accordingly.


Additionally, a research provided me with this information, I'm not sure if it's TRUE or if is going to help you.

The serial number is the key :)

If aabccdddeef is the serial number of the iPhone 4, ee represents the Color, (A4=black). I hope some of you here check this information with yours to see if this is true.


Just my 2 cents worth - if anyone is looking for the iPhone 5c colors, the colors below are picked from the apple website.

Hope it is of use to anyone:-)

iPhone 5c Colors:

GreenR   179G   243B   142HEX #B3F38EBlueR   123G   195B   252HEX #7BC3FCYellowR   255G   243B   141HEX #FFF38DRedR   252G   132B   142HEX #FF848EWhiteR   239G   239B   239HEX #EFEFEF