When initializing a CIColor
with a dynamic UIColor
(like the system colors that resolve differently based on light/dark mode) on macOS 14 (Mac Catalyst), the resulting CIColor
is invalid/uninitialized. For instance:
po CIColor(color: UIColor.systemGray2)
→ <uninitialized>
po CIColor(color: UIColor.systemGray2.resolvedColor(with: .current))
→ <CIColor 0x60000339afd0 (0.388235 0.388235 0.4 1) ExtendedSRGB>
But also, not all colors work even when resolved:
po CIColor(color: UIColor.systemGray.resolvedColor(with: .current))
→ <uninitialized>
I think this is caused by the color space of the resulting UIColor
:
po UIColor.systemGray.resolvedColor(with: .current)
→ kCGColorSpaceModelRGB 0.596078 0.596078 0.615686 1
po UIColor.systemGray2.resolvedColor(with: .current)
→ UIExtendedSRGBColorSpace 0.388235 0.388235 0.4 1
This worked correctly before in macOS 13.