Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xArtx

macrumors 6502a
Original poster
Mar 30, 2012
764
1
I watched Apple's September presentation on Apple TV.
One question, can we tell what colour the iPhone is?
 
Last edited by a moderator:
I watched Apple's September presentation on Apple TV.
One question, can we tell what colour the iPhone is?

I would assume so, since the UI changes the color theme based on the color of the device. I guess it's possible that Apple won't expose this info to us...
 
ALways thought the current one should know if it's black or white too,
just for a background theme.

Then will come the jailbreak hack to switch colours.
 
I remember reading a few months ago about how to get the home screen image so that your app could have the same frosted glass look that the phone app does. I imagine that's more useful for what you're trying to do than the color of the phone itself, which may, after all, have a case of any color on it, which you certainly wouldn't know. If the color of the exterior of the phone is really necessary, it might be best (and easiest) to just ask the user what color it is.
 
If the phone knows what colour it is, and iOS is prepared to tell you,
then asking the user would make you look silly.

I presume the iOS must know, unless iOS asks the user the colour during their iPhone setup,
but I think this would make Apple look a little silly too.

In four apps I still haven't used any stock components (not so much as a button or tab bar),
so I haven't given iOS any opportunity to use the phone colour (if it was going to) AFAIK.
by "if it was going to", I mean I don't know if iOS was going to try to tint the
buttons and other components inside apps or not.


I remember reading a few months ago about how to get the home screen image so that your app could have the same frosted glass look that the phone app does. I imagine that's more useful for what you're trying to do than the color of the phone itself, which may, after all, have a case of any color on it, which you certainly wouldn't know. If the color of the exterior of the phone is really necessary, it might be best (and easiest) to just ask the user what color it is.
 
Last edited by a moderator:
ALways thought the current one should know if it's black or white too,
just for a background theme.

Then will come the jailbreak hack to switch colours.

With the 5C I have been hoping the iOS would not only know what color the device is, but also offer (in Settings) to let you switch your matching wallpaper to one of the other colors... along the same idea as changing the case color. Why should it have to be a hack, they should just build it into the Settings options. The 5C is all about color anyway -- the body, the cases-- so they need to open it up and let it be about all the colors on the inside too, i.e. the wallpaper colors.
 
I presume the iOS must know, unless iOS asks the user the colour during their iPhone setup,
but I think this would make Apple look a little silly too.

This might just be something that is set in the factory. Until one can get a hold of a couple of different colored phones and do some experimenting, I would be leery to presume anything. If one changes the wallpaper color to a different choice, does resetting to factory settings change it back? We'll have to see, I guess.
 
I watched Apple's September presentation on Apple TV.
One question, can we tell what colour the iPhone is?

iTunes knows the color of all the supported devices I connect to my Mac. All my iOS devices are black, so I can't do much testing with those. But I have various colors of iPods of several generations; iTunes shows the actual color for all of them.

I don't know if iTunes is asking the devices what color they are or deriving the color from something else. (The color might be encoded in the serial number, for example.)
 
iTunes knows the color of all the supported devices I connect to my Mac. All my iOS devices are black, so I can't do much testing with those. But I have various colors of iPods of several generations; iTunes shows the actual color for all of them.

I don't know if iTunes is asking the devices what color they are or deriving the color from something else. (The color might be encoded in the serial number, for example.)

I didn't know that. I would say it is the serial number.
Doesn't mean we can access it.
 
Saw two tweets (1,2) on this subject by @stroughtonsmith. A few responses suggest this may be a private API. Given that, it is likely useless for any app you want to have on the App Store.

This seems to be limited to iOS 7. The return values are hex strings such as #d7d9d8. Oh yea, had to place the calls into a memory managed object. ARC doesn't like it.

Code:
 [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceEnclosureColor"];  // Detect back plate color of device.
 [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceColor"];  // Detect white or black iOS device.
 
Interesting, that means the black & white was not always there?
I'm going to attempt it, and let them reject it.
I suppose the hex strings are the component colour values.
At least we can easily find out exactly what they all are.

Saw two tweets (1,2) on this subject by @stroughtonsmith. A few responses suggest this may be a private API. Given that, it is likely useless for any app you want to have on the App Store.

This seems to be limited to iOS 7. The return values are hex strings such as #d7d9d8. Oh yea, had to place the calls into a memory managed object. ARC doesn't like it.

Code:
 [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceEnclosureColor"];  // Detect back plate color of device.
 [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceColor"];  // Detect white or black iOS device.


EDIT,,,
I thought that would be their white, but it actually looks too grey:
http://html-color-codes.info
Can't actually try it on a device ATM they have iOS7.
 
Last edited:
EDIT,,,
I thought that would be their white, but it actually looks too grey:
http://html-color-codes.info
Can't actually try it on a device ATM they have iOS7.

I wrote an app that runs on my iPhone 5. The attached image looks grayer on my Mac than the iPhone. That site also displays a gray for #e1e4e3 which is whiter on the the iPhone.
 

Attachments

  • DeviceColors.PNG
    DeviceColors.PNG
    27.6 KB · Views: 233
Saw two tweets (1,2) on this subject by @stroughtonsmith. A few responses suggest this may be a private API. Given that, it is likely useless for any app you want to have on the App Store.

This seems to be limited to iOS 7. The return values are hex strings such as #d7d9d8. Oh yea, had to place the calls into a memory managed object. ARC doesn't like it.

Code:
 [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceEnclosureColor"];  // Detect back plate color of device.
 [[UIDevice currentDevice] _deviceInfoForKey:@"DeviceColor"];  // Detect white or black iOS device.

I don't think the API is private, because I once searched for a way to figure out if the device is an iPhone or iPad and someone pointed to the currentDevice object filled with information about the device.
 
I don't think the API is private, because I once searched for a way to figure out if the device is an iPhone or iPad and someone pointed to the currentDevice object filled with information about the device.

currentDevice is not the private API. It's _deviceInfoForKey. Method names that start with underscores are almost certainly private.
 
currentDevice is not the private API. It's _deviceInfoForKey. Method names that start with underscores are almost certainly private.

Can you tell how they are found in the first place?

I haven't looked in any framework headers, but if we can't use them,
why would we even be supplied with them?

It would be interesting to know what is out there for personal apps that aren't destined for the App Store.
 
Can you tell how they are found in the first place?

I haven't looked in any framework headers, but if we can't use them,
why would we even be supplied with them?

It would be interesting to know what is out there for personal apps that aren't destined for the App Store.

Probably by using Obj-C runtime introspection functions. They allow you to do things like print out all the methods, properties, and iVars that a class or instance have. I used such functions a lot while experimenting with making an Xcode plugin, since I wanted to modify the behavior of various views in Xcode for which I didn't have the source code.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.