CAGradientLayer does not support Display P3/Wide Color

Number:rdar://42559318 Date Originated:July 24 2018
Status:Resolved Resolved:August 6, 2018
Product:Xcode Product Version:Version 10.0 beta 4 (10L213o)
Classification:Bug Reproducible:Yes

Core Animation


CAGradientLayer does not seem to support wide color.

Steps to Reproduce:

1. Create a CAGradientLayer
2. Set its colors to CGColors with a Display P3 color space
3. Note that the colors are rendered without wide color

Here's a code snippet I used to create the attached screenshot, which creates an all-pink "gradient."

let wideCGColor = CGColor(colorSpace: CGColorSpace(name: CGColorSpace.displayP3)!, components: [1, 0, 0.8, 1])!
let gradientLayer = CAGradientLayer()
gradientLayer.colors = [wideCGColor, wideCGColor]
gradientLayer.locations = [0, 1]

In attached the screenshot, I have a layer with the wide color being set as the background color, and the gradient layer underneath, which is noticeably "dull."

Expected Results:

The gradient layer should render wide colors as such.

Actual Results:

The gradient layer seems to ignore the wide color space.


Xcode Version 10.0 beta 4 (10L213o)
iOS Version 12.0 beta 4 (16A5327f)

This behavior was also present in Xcode 9.3 building to an iOS 11 device.


This is resolved in iOS 12 beta 6 (16A5345f)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!