Fixup missing colours and use resolved colours in UIKit.

Fix the confetti colour when using DesignKit.
Pin swift packages.
Fix UI tests target.
This commit is contained in:
Doug
2022-05-27 20:42:44 +01:00
committed by Doug
parent ad4674c0d4
commit 7d29bca319
30 changed files with 195 additions and 51 deletions
@@ -65,9 +65,12 @@ fileprivate extension Color {
///
/// SceneKit works in a colorspace with a linear gamma, which is why this conversion is necessary.
var floatComponents: [Float]? {
// Get the CGColor from a UIColor as it is nil on Color when loaded from an asset catalog.
let cgColor = UIColor(self).cgColor
guard
let colorSpace = CGColorSpace(name: CGColorSpace.extendedLinearSRGB),
let linearColor = cgColor?.converted(to: colorSpace, intent: .defaultIntent, options: nil),
let linearColor = cgColor.converted(to: colorSpace, intent: .defaultIntent, options: nil),
let components = linearColor.components
else { return nil }