Colors selected in Interface Builder always render as sRGB on a device
| Originator: | NexusCFX | ||
| Number: | rdar://28366571 | Date Originated: | Sept 19, 2016 |
| Status: | Open | Resolved: | |
| Product: | XCode | Product Version: | Version 8.0 (8A218a) |
| Classification: | Bug | Reproducible: | Always |
Summary: When selecting colors in Interface Builder there is now an option to vary based on a device's color gamut, and within the color selection clicking the gear icon in the top right allows one to select the color profile corresponding to the color space that the RGB values should be interpreted in. However, even when selecting the new Display P3 profile which is used on the 9.7" iPad Pro and iPhone 7 / 7 Plus the colors are still rendered in the sRGB color space. The attached project shows a basic example of this. The top view always displays sRGB (255,0,0) on all displays, while the bottom view should render sRGB (255,0,0) on sRGB displays, and P3 (255,0,0) on wide gamut displays. An additional note is that disabling the trait variation on the second view and uncommenting the line which sets the background color of the corresponding view in ViewController.swift allows for the correct behavior where the bottom view uses the most saturated red available in the P3 color gamut. Steps to Reproduce: 1. Install XCode, download the included project and install to a 9.7" iPad Pro or an iPhone 7 / 7 Plus 2. Run the project as it is currently configured 3. Remove the color variation for P3 gamut in Interface Builder, uncomment line 17 in ViewController.swift, then reinstall the app Expected Results: In both situations the app should look the same on a wide gamut iOS device. Actual Results: In reality, after running in step two the UIViews will have the same color, both of which only being the most saturated red available in sRGB. After running step three the bottom UIView will display a more saturated red corresponding to 615nm light, while the top will remain sRGB's less saturated red. Version: Version 8.0 (8A218a), macOS Sierra 10.12 Notes: Configuration: Occurs on all devices.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!