From 718c805b93d42653aec2461c54fa271b57ee1b0a Mon Sep 17 00:00:00 2001 From: "a.baranouski" Date: Tue, 7 Nov 2023 16:26:00 +0100 Subject: [PATCH 1/4] Update generated colors to be constant properties to pass strict concurrency checks --- Automation/update_colors.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Automation/update_colors.py b/Automation/update_colors.py index ac9e38ac669..01b7d7d67ae 100755 --- a/Automation/update_colors.py +++ b/Automation/update_colors.py @@ -76,9 +76,9 @@ source_filename_plural = f'Colors' source_group_template = '\n // MARK: - {group}' -source_line_template = ' /// Orbit {description} color.\n static var {name} = Color("{description}", bundle: .orbit)' +source_line_template = ' /// Orbit {description} color.\n static let {name} = Color("{description}", bundle: .orbit)' source_line_template_shape = ' /// Orbit {description} shape style.\n static var {name}: Self {{ .{name} }}' -source_line_template_uicolor = ' /// Orbit {description} color.\n static var {name} = fromResource(named: "{description}")' +source_line_template_uicolor = ' /// Orbit {description} color.\n static let {name} = fromResource(named: "{description}")' source_line_template_uiext = ' case .{name}: return.{name}' source_template = '''import SwiftUI From c9757eeb63c871a1fd8821221207ff185dae0103 Mon Sep 17 00:00:00 2001 From: "a.baranouski" Date: Tue, 7 Nov 2023 16:26:34 +0100 Subject: [PATCH 2/4] Run update colors script locally --- Sources/Orbit/Foundation/Colors/Colors.swift | 156 +++++++++--------- .../Blue/Blue Darker.colorset/Contents.json | 2 +- .../Orbit/Foundation/Colors/UIColors.swift | 156 +++++++++--------- 3 files changed, 157 insertions(+), 157 deletions(-) diff --git a/Sources/Orbit/Foundation/Colors/Colors.swift b/Sources/Orbit/Foundation/Colors/Colors.swift index 6756b66cc2c..be4e1fa0bf2 100644 --- a/Sources/Orbit/Foundation/Colors/Colors.swift +++ b/Sources/Orbit/Foundation/Colors/Colors.swift @@ -6,177 +6,177 @@ public extension Color { // MARK: - Blue /// Orbit Blue Dark color. - static var blueDark = Color("Blue Dark", bundle: .orbit) + static let blueDark = Color("Blue Dark", bundle: .orbit) /// Orbit Blue Dark Active color. - static var blueDarkActive = Color("Blue Dark Active", bundle: .orbit) + static let blueDarkActive = Color("Blue Dark Active", bundle: .orbit) /// Orbit Blue Dark Hover color. - static var blueDarkHover = Color("Blue Dark Hover", bundle: .orbit) + static let blueDarkHover = Color("Blue Dark Hover", bundle: .orbit) /// Orbit Blue Darker color. - static var blueDarker = Color("Blue Darker", bundle: .orbit) + static let blueDarker = Color("Blue Darker", bundle: .orbit) /// Orbit Blue Light color. - static var blueLight = Color("Blue Light", bundle: .orbit) + static let blueLight = Color("Blue Light", bundle: .orbit) /// Orbit Blue Light Active color. - static var blueLightActive = Color("Blue Light Active", bundle: .orbit) + static let blueLightActive = Color("Blue Light Active", bundle: .orbit) /// Orbit Blue Light Hover color. - static var blueLightHover = Color("Blue Light Hover", bundle: .orbit) + static let blueLightHover = Color("Blue Light Hover", bundle: .orbit) /// Orbit Blue Normal color. - static var blueNormal = Color("Blue Normal", bundle: .orbit) + static let blueNormal = Color("Blue Normal", bundle: .orbit) /// Orbit Blue Normal Active color. - static var blueNormalActive = Color("Blue Normal Active", bundle: .orbit) + static let blueNormalActive = Color("Blue Normal Active", bundle: .orbit) /// Orbit Blue Normal Hover color. - static var blueNormalHover = Color("Blue Normal Hover", bundle: .orbit) + static let blueNormalHover = Color("Blue Normal Hover", bundle: .orbit) // MARK: - Bundle /// Orbit Bundle Basic color. - static var bundleBasic = Color("Bundle Basic", bundle: .orbit) + static let bundleBasic = Color("Bundle Basic", bundle: .orbit) /// Orbit Bundle Medium color. - static var bundleMedium = Color("Bundle Medium", bundle: .orbit) + static let bundleMedium = Color("Bundle Medium", bundle: .orbit) // MARK: - Cloud /// Orbit Cloud Dark color. - static var cloudDark = Color("Cloud Dark", bundle: .orbit) + static let cloudDark = Color("Cloud Dark", bundle: .orbit) /// Orbit Cloud Dark Active color. - static var cloudDarkActive = Color("Cloud Dark Active", bundle: .orbit) + static let cloudDarkActive = Color("Cloud Dark Active", bundle: .orbit) /// Orbit Cloud Dark Hover color. - static var cloudDarkHover = Color("Cloud Dark Hover", bundle: .orbit) + static let cloudDarkHover = Color("Cloud Dark Hover", bundle: .orbit) /// Orbit Cloud Light color. - static var cloudLight = Color("Cloud Light", bundle: .orbit) + static let cloudLight = Color("Cloud Light", bundle: .orbit) /// Orbit Cloud Light Active color. - static var cloudLightActive = Color("Cloud Light Active", bundle: .orbit) + static let cloudLightActive = Color("Cloud Light Active", bundle: .orbit) /// Orbit Cloud Light Hover color. - static var cloudLightHover = Color("Cloud Light Hover", bundle: .orbit) + static let cloudLightHover = Color("Cloud Light Hover", bundle: .orbit) /// Orbit Cloud Normal color. - static var cloudNormal = Color("Cloud Normal", bundle: .orbit) + static let cloudNormal = Color("Cloud Normal", bundle: .orbit) /// Orbit Cloud Normal Active color. - static var cloudNormalActive = Color("Cloud Normal Active", bundle: .orbit) + static let cloudNormalActive = Color("Cloud Normal Active", bundle: .orbit) /// Orbit Cloud Normal Hover color. - static var cloudNormalHover = Color("Cloud Normal Hover", bundle: .orbit) + static let cloudNormalHover = Color("Cloud Normal Hover", bundle: .orbit) // MARK: - Green /// Orbit Green Dark color. - static var greenDark = Color("Green Dark", bundle: .orbit) + static let greenDark = Color("Green Dark", bundle: .orbit) /// Orbit Green Dark Active color. - static var greenDarkActive = Color("Green Dark Active", bundle: .orbit) + static let greenDarkActive = Color("Green Dark Active", bundle: .orbit) /// Orbit Green Dark Hover color. - static var greenDarkHover = Color("Green Dark Hover", bundle: .orbit) + static let greenDarkHover = Color("Green Dark Hover", bundle: .orbit) /// Orbit Green Darker color. - static var greenDarker = Color("Green Darker", bundle: .orbit) + static let greenDarker = Color("Green Darker", bundle: .orbit) /// Orbit Green Light color. - static var greenLight = Color("Green Light", bundle: .orbit) + static let greenLight = Color("Green Light", bundle: .orbit) /// Orbit Green Light Active color. - static var greenLightActive = Color("Green Light Active", bundle: .orbit) + static let greenLightActive = Color("Green Light Active", bundle: .orbit) /// Orbit Green Light Hover color. - static var greenLightHover = Color("Green Light Hover", bundle: .orbit) + static let greenLightHover = Color("Green Light Hover", bundle: .orbit) /// Orbit Green Normal color. - static var greenNormal = Color("Green Normal", bundle: .orbit) + static let greenNormal = Color("Green Normal", bundle: .orbit) /// Orbit Green Normal Active color. - static var greenNormalActive = Color("Green Normal Active", bundle: .orbit) + static let greenNormalActive = Color("Green Normal Active", bundle: .orbit) /// Orbit Green Normal Hover color. - static var greenNormalHover = Color("Green Normal Hover", bundle: .orbit) + static let greenNormalHover = Color("Green Normal Hover", bundle: .orbit) // MARK: - Ink /// Orbit Ink Dark color. - static var inkDark = Color("Ink Dark", bundle: .orbit) + static let inkDark = Color("Ink Dark", bundle: .orbit) /// Orbit Ink Dark Active color. - static var inkDarkActive = Color("Ink Dark Active", bundle: .orbit) + static let inkDarkActive = Color("Ink Dark Active", bundle: .orbit) /// Orbit Ink Dark Hover color. - static var inkDarkHover = Color("Ink Dark Hover", bundle: .orbit) + static let inkDarkHover = Color("Ink Dark Hover", bundle: .orbit) /// Orbit Ink Light color. - static var inkLight = Color("Ink Light", bundle: .orbit) + static let inkLight = Color("Ink Light", bundle: .orbit) /// Orbit Ink Light Active color. - static var inkLightActive = Color("Ink Light Active", bundle: .orbit) + static let inkLightActive = Color("Ink Light Active", bundle: .orbit) /// Orbit Ink Light Hover color. - static var inkLightHover = Color("Ink Light Hover", bundle: .orbit) + static let inkLightHover = Color("Ink Light Hover", bundle: .orbit) /// Orbit Ink Normal color. - static var inkNormal = Color("Ink Normal", bundle: .orbit) + static let inkNormal = Color("Ink Normal", bundle: .orbit) /// Orbit Ink Normal Active color. - static var inkNormalActive = Color("Ink Normal Active", bundle: .orbit) + static let inkNormalActive = Color("Ink Normal Active", bundle: .orbit) /// Orbit Ink Normal Hover color. - static var inkNormalHover = Color("Ink Normal Hover", bundle: .orbit) + static let inkNormalHover = Color("Ink Normal Hover", bundle: .orbit) // MARK: - Orange /// Orbit Orange Dark color. - static var orangeDark = Color("Orange Dark", bundle: .orbit) + static let orangeDark = Color("Orange Dark", bundle: .orbit) /// Orbit Orange Dark Active color. - static var orangeDarkActive = Color("Orange Dark Active", bundle: .orbit) + static let orangeDarkActive = Color("Orange Dark Active", bundle: .orbit) /// Orbit Orange Dark Hover color. - static var orangeDarkHover = Color("Orange Dark Hover", bundle: .orbit) + static let orangeDarkHover = Color("Orange Dark Hover", bundle: .orbit) /// Orbit Orange Darker color. - static var orangeDarker = Color("Orange Darker", bundle: .orbit) + static let orangeDarker = Color("Orange Darker", bundle: .orbit) /// Orbit Orange Light color. - static var orangeLight = Color("Orange Light", bundle: .orbit) + static let orangeLight = Color("Orange Light", bundle: .orbit) /// Orbit Orange Light Active color. - static var orangeLightActive = Color("Orange Light Active", bundle: .orbit) + static let orangeLightActive = Color("Orange Light Active", bundle: .orbit) /// Orbit Orange Light Hover color. - static var orangeLightHover = Color("Orange Light Hover", bundle: .orbit) + static let orangeLightHover = Color("Orange Light Hover", bundle: .orbit) /// Orbit Orange Normal color. - static var orangeNormal = Color("Orange Normal", bundle: .orbit) + static let orangeNormal = Color("Orange Normal", bundle: .orbit) /// Orbit Orange Normal Active color. - static var orangeNormalActive = Color("Orange Normal Active", bundle: .orbit) + static let orangeNormalActive = Color("Orange Normal Active", bundle: .orbit) /// Orbit Orange Normal Hover color. - static var orangeNormalHover = Color("Orange Normal Hover", bundle: .orbit) + static let orangeNormalHover = Color("Orange Normal Hover", bundle: .orbit) // MARK: - Product /// Orbit Product Dark color. - static var productDark = Color("Product Dark", bundle: .orbit) + static let productDark = Color("Product Dark", bundle: .orbit) /// Orbit Product Dark Active color. - static var productDarkActive = Color("Product Dark Active", bundle: .orbit) + static let productDarkActive = Color("Product Dark Active", bundle: .orbit) /// Orbit Product Dark Hover color. - static var productDarkHover = Color("Product Dark Hover", bundle: .orbit) + static let productDarkHover = Color("Product Dark Hover", bundle: .orbit) /// Orbit Product Darker color. - static var productDarker = Color("Product Darker", bundle: .orbit) + static let productDarker = Color("Product Darker", bundle: .orbit) /// Orbit Product Light color. - static var productLight = Color("Product Light", bundle: .orbit) + static let productLight = Color("Product Light", bundle: .orbit) /// Orbit Product Light Active color. - static var productLightActive = Color("Product Light Active", bundle: .orbit) + static let productLightActive = Color("Product Light Active", bundle: .orbit) /// Orbit Product Light Hover color. - static var productLightHover = Color("Product Light Hover", bundle: .orbit) + static let productLightHover = Color("Product Light Hover", bundle: .orbit) /// Orbit Product Normal color. - static var productNormal = Color("Product Normal", bundle: .orbit) + static let productNormal = Color("Product Normal", bundle: .orbit) /// Orbit Product Normal Active color. - static var productNormalActive = Color("Product Normal Active", bundle: .orbit) + static let productNormalActive = Color("Product Normal Active", bundle: .orbit) /// Orbit Product Normal Hover color. - static var productNormalHover = Color("Product Normal Hover", bundle: .orbit) + static let productNormalHover = Color("Product Normal Hover", bundle: .orbit) // MARK: - Red /// Orbit Red Dark color. - static var redDark = Color("Red Dark", bundle: .orbit) + static let redDark = Color("Red Dark", bundle: .orbit) /// Orbit Red Dark Active color. - static var redDarkActive = Color("Red Dark Active", bundle: .orbit) + static let redDarkActive = Color("Red Dark Active", bundle: .orbit) /// Orbit Red Dark Hover color. - static var redDarkHover = Color("Red Dark Hover", bundle: .orbit) + static let redDarkHover = Color("Red Dark Hover", bundle: .orbit) /// Orbit Red Darker color. - static var redDarker = Color("Red Darker", bundle: .orbit) + static let redDarker = Color("Red Darker", bundle: .orbit) /// Orbit Red Light color. - static var redLight = Color("Red Light", bundle: .orbit) + static let redLight = Color("Red Light", bundle: .orbit) /// Orbit Red Light Active color. - static var redLightActive = Color("Red Light Active", bundle: .orbit) + static let redLightActive = Color("Red Light Active", bundle: .orbit) /// Orbit Red Light Hover color. - static var redLightHover = Color("Red Light Hover", bundle: .orbit) + static let redLightHover = Color("Red Light Hover", bundle: .orbit) /// Orbit Red Normal color. - static var redNormal = Color("Red Normal", bundle: .orbit) + static let redNormal = Color("Red Normal", bundle: .orbit) /// Orbit Red Normal Active color. - static var redNormalActive = Color("Red Normal Active", bundle: .orbit) + static let redNormalActive = Color("Red Normal Active", bundle: .orbit) /// Orbit Red Normal Hover color. - static var redNormalHover = Color("Red Normal Hover", bundle: .orbit) + static let redNormalHover = Color("Red Normal Hover", bundle: .orbit) // MARK: - Social /// Orbit Social Facebook color. - static var socialFacebook = Color("Social Facebook", bundle: .orbit) + static let socialFacebook = Color("Social Facebook", bundle: .orbit) /// Orbit Social Facebook Active color. - static var socialFacebookActive = Color("Social Facebook Active", bundle: .orbit) + static let socialFacebookActive = Color("Social Facebook Active", bundle: .orbit) /// Orbit Social Facebook Hover color. - static var socialFacebookHover = Color("Social Facebook Hover", bundle: .orbit) + static let socialFacebookHover = Color("Social Facebook Hover", bundle: .orbit) // MARK: - White /// Orbit White Active color. - static var whiteActive = Color("White Active", bundle: .orbit) + static let whiteActive = Color("White Active", bundle: .orbit) /// Orbit White Darker color. - static var whiteDarker = Color("White Darker", bundle: .orbit) + static let whiteDarker = Color("White Darker", bundle: .orbit) /// Orbit White Hover color. - static var whiteHover = Color("White Hover", bundle: .orbit) + static let whiteHover = Color("White Hover", bundle: .orbit) /// Orbit White Lighter color. - static var whiteLighter = Color("White Lighter", bundle: .orbit) + static let whiteLighter = Color("White Lighter", bundle: .orbit) /// Orbit White Normal color. - static var whiteNormal = Color("White Normal", bundle: .orbit) + static let whiteNormal = Color("White Normal", bundle: .orbit) } diff --git a/Sources/Orbit/Foundation/Colors/Colors.xcassets/Blue/Blue Darker.colorset/Contents.json b/Sources/Orbit/Foundation/Colors/Colors.xcassets/Blue/Blue Darker.colorset/Contents.json index c775c46699a..6b7e8433a02 100644 --- a/Sources/Orbit/Foundation/Colors/Colors.xcassets/Blue/Blue Darker.colorset/Contents.json +++ b/Sources/Orbit/Foundation/Colors/Colors.xcassets/Blue/Blue Darker.colorset/Contents.json @@ -25,7 +25,7 @@ "alpha" : "1.000", "blue" : "0xFE", "green" : "0xDD", - "red" : "0xB3" + "red" : "0xB2" } }, "idiom" : "universal" diff --git a/Sources/Orbit/Foundation/Colors/UIColors.swift b/Sources/Orbit/Foundation/Colors/UIColors.swift index 28489386903..e45219d9afe 100644 --- a/Sources/Orbit/Foundation/Colors/UIColors.swift +++ b/Sources/Orbit/Foundation/Colors/UIColors.swift @@ -6,177 +6,177 @@ public extension UIColor { // MARK: - Blue /// Orbit Blue Dark color. - static var blueDark = fromResource(named: "Blue Dark") + static let blueDark = fromResource(named: "Blue Dark") /// Orbit Blue Dark Active color. - static var blueDarkActive = fromResource(named: "Blue Dark Active") + static let blueDarkActive = fromResource(named: "Blue Dark Active") /// Orbit Blue Dark Hover color. - static var blueDarkHover = fromResource(named: "Blue Dark Hover") + static let blueDarkHover = fromResource(named: "Blue Dark Hover") /// Orbit Blue Darker color. - static var blueDarker = fromResource(named: "Blue Darker") + static let blueDarker = fromResource(named: "Blue Darker") /// Orbit Blue Light color. - static var blueLight = fromResource(named: "Blue Light") + static let blueLight = fromResource(named: "Blue Light") /// Orbit Blue Light Active color. - static var blueLightActive = fromResource(named: "Blue Light Active") + static let blueLightActive = fromResource(named: "Blue Light Active") /// Orbit Blue Light Hover color. - static var blueLightHover = fromResource(named: "Blue Light Hover") + static let blueLightHover = fromResource(named: "Blue Light Hover") /// Orbit Blue Normal color. - static var blueNormal = fromResource(named: "Blue Normal") + static let blueNormal = fromResource(named: "Blue Normal") /// Orbit Blue Normal Active color. - static var blueNormalActive = fromResource(named: "Blue Normal Active") + static let blueNormalActive = fromResource(named: "Blue Normal Active") /// Orbit Blue Normal Hover color. - static var blueNormalHover = fromResource(named: "Blue Normal Hover") + static let blueNormalHover = fromResource(named: "Blue Normal Hover") // MARK: - Bundle /// Orbit Bundle Basic color. - static var bundleBasic = fromResource(named: "Bundle Basic") + static let bundleBasic = fromResource(named: "Bundle Basic") /// Orbit Bundle Medium color. - static var bundleMedium = fromResource(named: "Bundle Medium") + static let bundleMedium = fromResource(named: "Bundle Medium") // MARK: - Cloud /// Orbit Cloud Dark color. - static var cloudDark = fromResource(named: "Cloud Dark") + static let cloudDark = fromResource(named: "Cloud Dark") /// Orbit Cloud Dark Active color. - static var cloudDarkActive = fromResource(named: "Cloud Dark Active") + static let cloudDarkActive = fromResource(named: "Cloud Dark Active") /// Orbit Cloud Dark Hover color. - static var cloudDarkHover = fromResource(named: "Cloud Dark Hover") + static let cloudDarkHover = fromResource(named: "Cloud Dark Hover") /// Orbit Cloud Light color. - static var cloudLight = fromResource(named: "Cloud Light") + static let cloudLight = fromResource(named: "Cloud Light") /// Orbit Cloud Light Active color. - static var cloudLightActive = fromResource(named: "Cloud Light Active") + static let cloudLightActive = fromResource(named: "Cloud Light Active") /// Orbit Cloud Light Hover color. - static var cloudLightHover = fromResource(named: "Cloud Light Hover") + static let cloudLightHover = fromResource(named: "Cloud Light Hover") /// Orbit Cloud Normal color. - static var cloudNormal = fromResource(named: "Cloud Normal") + static let cloudNormal = fromResource(named: "Cloud Normal") /// Orbit Cloud Normal Active color. - static var cloudNormalActive = fromResource(named: "Cloud Normal Active") + static let cloudNormalActive = fromResource(named: "Cloud Normal Active") /// Orbit Cloud Normal Hover color. - static var cloudNormalHover = fromResource(named: "Cloud Normal Hover") + static let cloudNormalHover = fromResource(named: "Cloud Normal Hover") // MARK: - Green /// Orbit Green Dark color. - static var greenDark = fromResource(named: "Green Dark") + static let greenDark = fromResource(named: "Green Dark") /// Orbit Green Dark Active color. - static var greenDarkActive = fromResource(named: "Green Dark Active") + static let greenDarkActive = fromResource(named: "Green Dark Active") /// Orbit Green Dark Hover color. - static var greenDarkHover = fromResource(named: "Green Dark Hover") + static let greenDarkHover = fromResource(named: "Green Dark Hover") /// Orbit Green Darker color. - static var greenDarker = fromResource(named: "Green Darker") + static let greenDarker = fromResource(named: "Green Darker") /// Orbit Green Light color. - static var greenLight = fromResource(named: "Green Light") + static let greenLight = fromResource(named: "Green Light") /// Orbit Green Light Active color. - static var greenLightActive = fromResource(named: "Green Light Active") + static let greenLightActive = fromResource(named: "Green Light Active") /// Orbit Green Light Hover color. - static var greenLightHover = fromResource(named: "Green Light Hover") + static let greenLightHover = fromResource(named: "Green Light Hover") /// Orbit Green Normal color. - static var greenNormal = fromResource(named: "Green Normal") + static let greenNormal = fromResource(named: "Green Normal") /// Orbit Green Normal Active color. - static var greenNormalActive = fromResource(named: "Green Normal Active") + static let greenNormalActive = fromResource(named: "Green Normal Active") /// Orbit Green Normal Hover color. - static var greenNormalHover = fromResource(named: "Green Normal Hover") + static let greenNormalHover = fromResource(named: "Green Normal Hover") // MARK: - Ink /// Orbit Ink Dark color. - static var inkDark = fromResource(named: "Ink Dark") + static let inkDark = fromResource(named: "Ink Dark") /// Orbit Ink Dark Active color. - static var inkDarkActive = fromResource(named: "Ink Dark Active") + static let inkDarkActive = fromResource(named: "Ink Dark Active") /// Orbit Ink Dark Hover color. - static var inkDarkHover = fromResource(named: "Ink Dark Hover") + static let inkDarkHover = fromResource(named: "Ink Dark Hover") /// Orbit Ink Light color. - static var inkLight = fromResource(named: "Ink Light") + static let inkLight = fromResource(named: "Ink Light") /// Orbit Ink Light Active color. - static var inkLightActive = fromResource(named: "Ink Light Active") + static let inkLightActive = fromResource(named: "Ink Light Active") /// Orbit Ink Light Hover color. - static var inkLightHover = fromResource(named: "Ink Light Hover") + static let inkLightHover = fromResource(named: "Ink Light Hover") /// Orbit Ink Normal color. - static var inkNormal = fromResource(named: "Ink Normal") + static let inkNormal = fromResource(named: "Ink Normal") /// Orbit Ink Normal Active color. - static var inkNormalActive = fromResource(named: "Ink Normal Active") + static let inkNormalActive = fromResource(named: "Ink Normal Active") /// Orbit Ink Normal Hover color. - static var inkNormalHover = fromResource(named: "Ink Normal Hover") + static let inkNormalHover = fromResource(named: "Ink Normal Hover") // MARK: - Orange /// Orbit Orange Dark color. - static var orangeDark = fromResource(named: "Orange Dark") + static let orangeDark = fromResource(named: "Orange Dark") /// Orbit Orange Dark Active color. - static var orangeDarkActive = fromResource(named: "Orange Dark Active") + static let orangeDarkActive = fromResource(named: "Orange Dark Active") /// Orbit Orange Dark Hover color. - static var orangeDarkHover = fromResource(named: "Orange Dark Hover") + static let orangeDarkHover = fromResource(named: "Orange Dark Hover") /// Orbit Orange Darker color. - static var orangeDarker = fromResource(named: "Orange Darker") + static let orangeDarker = fromResource(named: "Orange Darker") /// Orbit Orange Light color. - static var orangeLight = fromResource(named: "Orange Light") + static let orangeLight = fromResource(named: "Orange Light") /// Orbit Orange Light Active color. - static var orangeLightActive = fromResource(named: "Orange Light Active") + static let orangeLightActive = fromResource(named: "Orange Light Active") /// Orbit Orange Light Hover color. - static var orangeLightHover = fromResource(named: "Orange Light Hover") + static let orangeLightHover = fromResource(named: "Orange Light Hover") /// Orbit Orange Normal color. - static var orangeNormal = fromResource(named: "Orange Normal") + static let orangeNormal = fromResource(named: "Orange Normal") /// Orbit Orange Normal Active color. - static var orangeNormalActive = fromResource(named: "Orange Normal Active") + static let orangeNormalActive = fromResource(named: "Orange Normal Active") /// Orbit Orange Normal Hover color. - static var orangeNormalHover = fromResource(named: "Orange Normal Hover") + static let orangeNormalHover = fromResource(named: "Orange Normal Hover") // MARK: - Product /// Orbit Product Dark color. - static var productDark = fromResource(named: "Product Dark") + static let productDark = fromResource(named: "Product Dark") /// Orbit Product Dark Active color. - static var productDarkActive = fromResource(named: "Product Dark Active") + static let productDarkActive = fromResource(named: "Product Dark Active") /// Orbit Product Dark Hover color. - static var productDarkHover = fromResource(named: "Product Dark Hover") + static let productDarkHover = fromResource(named: "Product Dark Hover") /// Orbit Product Darker color. - static var productDarker = fromResource(named: "Product Darker") + static let productDarker = fromResource(named: "Product Darker") /// Orbit Product Light color. - static var productLight = fromResource(named: "Product Light") + static let productLight = fromResource(named: "Product Light") /// Orbit Product Light Active color. - static var productLightActive = fromResource(named: "Product Light Active") + static let productLightActive = fromResource(named: "Product Light Active") /// Orbit Product Light Hover color. - static var productLightHover = fromResource(named: "Product Light Hover") + static let productLightHover = fromResource(named: "Product Light Hover") /// Orbit Product Normal color. - static var productNormal = fromResource(named: "Product Normal") + static let productNormal = fromResource(named: "Product Normal") /// Orbit Product Normal Active color. - static var productNormalActive = fromResource(named: "Product Normal Active") + static let productNormalActive = fromResource(named: "Product Normal Active") /// Orbit Product Normal Hover color. - static var productNormalHover = fromResource(named: "Product Normal Hover") + static let productNormalHover = fromResource(named: "Product Normal Hover") // MARK: - Red /// Orbit Red Dark color. - static var redDark = fromResource(named: "Red Dark") + static let redDark = fromResource(named: "Red Dark") /// Orbit Red Dark Active color. - static var redDarkActive = fromResource(named: "Red Dark Active") + static let redDarkActive = fromResource(named: "Red Dark Active") /// Orbit Red Dark Hover color. - static var redDarkHover = fromResource(named: "Red Dark Hover") + static let redDarkHover = fromResource(named: "Red Dark Hover") /// Orbit Red Darker color. - static var redDarker = fromResource(named: "Red Darker") + static let redDarker = fromResource(named: "Red Darker") /// Orbit Red Light color. - static var redLight = fromResource(named: "Red Light") + static let redLight = fromResource(named: "Red Light") /// Orbit Red Light Active color. - static var redLightActive = fromResource(named: "Red Light Active") + static let redLightActive = fromResource(named: "Red Light Active") /// Orbit Red Light Hover color. - static var redLightHover = fromResource(named: "Red Light Hover") + static let redLightHover = fromResource(named: "Red Light Hover") /// Orbit Red Normal color. - static var redNormal = fromResource(named: "Red Normal") + static let redNormal = fromResource(named: "Red Normal") /// Orbit Red Normal Active color. - static var redNormalActive = fromResource(named: "Red Normal Active") + static let redNormalActive = fromResource(named: "Red Normal Active") /// Orbit Red Normal Hover color. - static var redNormalHover = fromResource(named: "Red Normal Hover") + static let redNormalHover = fromResource(named: "Red Normal Hover") // MARK: - Social /// Orbit Social Facebook color. - static var socialFacebook = fromResource(named: "Social Facebook") + static let socialFacebook = fromResource(named: "Social Facebook") /// Orbit Social Facebook Active color. - static var socialFacebookActive = fromResource(named: "Social Facebook Active") + static let socialFacebookActive = fromResource(named: "Social Facebook Active") /// Orbit Social Facebook Hover color. - static var socialFacebookHover = fromResource(named: "Social Facebook Hover") + static let socialFacebookHover = fromResource(named: "Social Facebook Hover") // MARK: - White /// Orbit White Active color. - static var whiteActive = fromResource(named: "White Active") + static let whiteActive = fromResource(named: "White Active") /// Orbit White Darker color. - static var whiteDarker = fromResource(named: "White Darker") + static let whiteDarker = fromResource(named: "White Darker") /// Orbit White Hover color. - static var whiteHover = fromResource(named: "White Hover") + static let whiteHover = fromResource(named: "White Hover") /// Orbit White Lighter color. - static var whiteLighter = fromResource(named: "White Lighter") + static let whiteLighter = fromResource(named: "White Lighter") /// Orbit White Normal color. - static var whiteNormal = fromResource(named: "White Normal") + static let whiteNormal = fromResource(named: "White Normal") } From 2db674c2f4d99603f42fe7c4affcc166adafe95c Mon Sep 17 00:00:00 2001 From: "a.baranouski" Date: Tue, 7 Nov 2023 16:27:18 +0100 Subject: [PATCH 3/4] Change colors to constant properties to pass strict concurrency checks --- .../Orbit/Foundation/Colors/Gradients.swift | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Sources/Orbit/Foundation/Colors/Gradients.swift b/Sources/Orbit/Foundation/Colors/Gradients.swift index e354b083533..16bc57eb203 100644 --- a/Sources/Orbit/Foundation/Colors/Gradients.swift +++ b/Sources/Orbit/Foundation/Colors/Gradients.swift @@ -69,12 +69,12 @@ public extension ShapeStyle where Self == LinearGradient { public extension Color { - static var bundleBasicStart: Color = .init(.bundleBasicStart) - static var bundleBasicEnd: Color = .init(.bundleBasicEnd) - static var bundleMediumStart: Color = .init(.bundleMediumStart) - static var bundleMediumEnd: Color = .init(.bundleMediumEnd) - static var bundleTopStart: Color = .init(.bundleTopStart) - static var bundleTopEnd: Color = .init(.bundleTopEnd) + static let bundleBasicStart: Color = .init(.bundleBasicStart) + static let bundleBasicEnd: Color = .init(.bundleBasicEnd) + static let bundleMediumStart: Color = .init(.bundleMediumStart) + static let bundleMediumEnd: Color = .init(.bundleMediumEnd) + static let bundleTopStart: Color = .init(.bundleTopStart) + static let bundleTopEnd: Color = .init(.bundleTopEnd) } public extension ShapeStyle where Self == Color { @@ -89,10 +89,10 @@ public extension ShapeStyle where Self == Color { public extension UIColor { - static var bundleBasicStart = UIColor(red: 0.882, green: 0.243, blue: 0.231, alpha: 1) - static var bundleBasicEnd = UIColor(red: 0.91, green: 0.494, blue: 0.035, alpha: 1) - static var bundleMediumStart = UIColor(red: 0.216, green: 0.098, blue: 0.671, alpha: 1) - static var bundleMediumEnd = UIColor(red: 0.522, green: 0.224, blue: 0.859, alpha: 1) - static var bundleTopStart = UIColor(red: 0.176, green: 0.176, blue: 0.18, alpha: 1) - static var bundleTopEnd = UIColor(red: 0.412, green: 0.431, blue: 0.451, alpha: 1) + static let bundleBasicStart = UIColor(red: 0.882, green: 0.243, blue: 0.231, alpha: 1) + static let bundleBasicEnd = UIColor(red: 0.91, green: 0.494, blue: 0.035, alpha: 1) + static let bundleMediumStart = UIColor(red: 0.216, green: 0.098, blue: 0.671, alpha: 1) + static let bundleMediumEnd = UIColor(red: 0.522, green: 0.224, blue: 0.859, alpha: 1) + static let bundleTopStart = UIColor(red: 0.176, green: 0.176, blue: 0.18, alpha: 1) + static let bundleTopEnd = UIColor(red: 0.412, green: 0.431, blue: 0.451, alpha: 1) } From 0b1867f6719204766cdbc4f082c44dfd1a9b3de8 Mon Sep 17 00:00:00 2001 From: "a.baranouski" Date: Tue, 14 Nov 2023 16:50:46 +0100 Subject: [PATCH 4/4] Delete color picker from Storyboard --- .../Foundation/StorybookColors.swift | 182 ++++++++---------- 1 file changed, 84 insertions(+), 98 deletions(-) diff --git a/Sources/OrbitStorybook/Foundation/StorybookColors.swift b/Sources/OrbitStorybook/Foundation/StorybookColors.swift index 06de1adbbbb..80893cf30a3 100644 --- a/Sources/OrbitStorybook/Foundation/StorybookColors.swift +++ b/Sources/OrbitStorybook/Foundation/StorybookColors.swift @@ -6,62 +6,62 @@ struct StorybookBasicColors: View { var body: some View { VStack(spacing: 0) { ColorCard(title: "White") { - ColorContent(color: &.whiteLighter, uiColor: &.whiteLighter, label: "White", variant: "lighter (dark-mode)") + ColorContent(color: .whiteLighter, uiColor: .whiteLighter, label: "White", variant: "lighter (dark-mode)") .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.whiteNormal, uiColor: &.whiteNormal, label: "White") - ColorContent(color: &.whiteHover, uiColor: &.whiteHover, label: "White", variant: "hover") - ColorContent(color: &.whiteActive, uiColor: &.whiteActive, label: "White", variant: "active") + ColorContent(color: .whiteNormal, uiColor: .whiteNormal, label: "White") + ColorContent(color: .whiteHover, uiColor: .whiteHover, label: "White", variant: "hover") + ColorContent(color: .whiteActive, uiColor: .whiteActive, label: "White", variant: "active") } .fixedSize(horizontal: false, vertical: true) - ColorContent(color: &.whiteDarker, uiColor: &.whiteDarker, label: "White", variant: "darker (dark-mode)") + ColorContent(color: .whiteDarker, uiColor: .whiteDarker, label: "White", variant: "darker (dark-mode)") .fixedSize(horizontal: false, vertical: true) } ColorCard(title: "Cloud") { HStack(spacing: 0) { - ColorContent(color: &.cloudLight, uiColor: &.cloudLight, label: "Cloud Light") - ColorContent(color: &.cloudLightHover, uiColor: &.cloudLightHover, label: "Cloud Light", variant: "hover") - ColorContent(color: &.cloudLightActive, uiColor: &.cloudLightActive, label: "Cloud Light", variant: "active") + ColorContent(color: .cloudLight, uiColor: .cloudLight, label: "Cloud Light") + ColorContent(color: .cloudLightHover, uiColor: .cloudLightHover, label: "Cloud Light", variant: "hover") + ColorContent(color: .cloudLightActive, uiColor: .cloudLightActive, label: "Cloud Light", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.cloudNormal, uiColor: &.cloudNormal, label: "Cloud Normal") - ColorContent(color: &.cloudNormalHover, uiColor: &.cloudNormalHover, label: "Cloud Normal", variant: "hover") - ColorContent(color: &.cloudNormalActive, uiColor: &.cloudNormalActive, label: "Cloud Normal", variant: "active") + ColorContent(color: .cloudNormal, uiColor: .cloudNormal, label: "Cloud Normal") + ColorContent(color: .cloudNormalHover, uiColor: .cloudNormalHover, label: "Cloud Normal", variant: "hover") + ColorContent(color: .cloudNormalActive, uiColor: .cloudNormalActive, label: "Cloud Normal", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.cloudDark, uiColor: &.cloudDark, label: "Cloud Dark") - ColorContent(color: &.cloudDarkHover, uiColor: &.cloudDarkHover, label: "Cloud Dark", variant: "hover") - ColorContent(color: &.cloudDarkActive, uiColor: &.cloudDarkActive, label: "Cloud Dark", variant: "active") + ColorContent(color: .cloudDark, uiColor: .cloudDark, label: "Cloud Dark") + ColorContent(color: .cloudDarkHover, uiColor: .cloudDarkHover, label: "Cloud Dark", variant: "hover") + ColorContent(color: .cloudDarkActive, uiColor: .cloudDarkActive, label: "Cloud Dark", variant: "active") } .fixedSize(horizontal: false, vertical: true) } ColorCard(title: "Ink") { HStack(spacing: 0) { - ColorContent(color: &.inkLight, uiColor: &.inkLight, label: "Ink Light") - ColorContent(color: &.inkLightHover, uiColor: &.inkLightHover, label: "Ink Light", variant: "hover") - ColorContent(color: &.inkLightActive, uiColor: &.inkLightActive, label: "Ink Light", variant: "active") + ColorContent(color: .inkLight, uiColor: .inkLight, label: "Ink Light") + ColorContent(color: .inkLightHover, uiColor: .inkLightHover, label: "Ink Light", variant: "hover") + ColorContent(color: .inkLightActive, uiColor: .inkLightActive, label: "Ink Light", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.inkNormal, uiColor: &.inkNormal, label: "Ink Normal") - ColorContent(color: &.inkNormalHover, uiColor: &.inkNormalHover, label: "Ink Normal", variant: "hover") - ColorContent(color: &.inkNormalActive, uiColor: &.inkNormalActive, label: "Ink Normal", variant: "active") + ColorContent(color: .inkNormal, uiColor: .inkNormal, label: "Ink Normal") + ColorContent(color: .inkNormalHover, uiColor: .inkNormalHover, label: "Ink Normal", variant: "hover") + ColorContent(color: .inkNormalActive, uiColor: .inkNormalActive, label: "Ink Normal", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.inkDark, uiColor: &.inkDark, label: "Ink Dark") - ColorContent(color: &.inkDarkHover, uiColor: &.inkDarkHover, label: "Ink Dark", variant: "hover") - ColorContent(color: &.inkDarkActive, uiColor: &.inkDarkActive, label: "Ink Dark", variant: "active") + ColorContent(color: .inkDark, uiColor: .inkDark, label: "Ink Dark") + ColorContent(color: .inkDarkHover, uiColor: .inkDarkHover, label: "Ink Dark", variant: "hover") + ColorContent(color: .inkDarkActive, uiColor: .inkDarkActive, label: "Ink Dark", variant: "active") } .fixedSize(horizontal: false, vertical: true) } @@ -75,27 +75,27 @@ struct StorybookProductColors: View { VStack(spacing: 0) { ColorCard(title: "Product") { HStack(spacing: 0) { - ColorContent(color: &.productLight, uiColor: &.productLight, label: "Product Light") - ColorContent(color: &.productLightHover, uiColor: &.productLightHover, label: "Product Light", variant: "hover") - ColorContent(color: &.productLightActive, uiColor: &.productLightActive, label: "Product Light", variant: "active") + ColorContent(color: .productLight, uiColor: .productLight, label: "Product Light") + ColorContent(color: .productLightHover, uiColor: .productLightHover, label: "Product Light", variant: "hover") + ColorContent(color: .productLightActive, uiColor: .productLightActive, label: "Product Light", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.productNormal, uiColor: &.productNormal, label: "Product Normal") - ColorContent(color: &.productNormalHover, uiColor: &.productNormalHover, label: "Product Normal", variant: "hover") - ColorContent(color: &.productNormalActive, uiColor: &.productNormalActive, label: "Product Normal", variant: "active") + ColorContent(color: .productNormal, uiColor: .productNormal, label: "Product Normal") + ColorContent(color: .productNormalHover, uiColor: .productNormalHover, label: "Product Normal", variant: "hover") + ColorContent(color: .productNormalActive, uiColor: .productNormalActive, label: "Product Normal", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.productDark, uiColor: &.productDark, label: "Product Dark") - ColorContent(color: &.productDarkHover, uiColor: &.productDarkHover, label: "Product Dark", variant: "hover") - ColorContent(color: &.productDarkActive, uiColor: &.productDarkActive, label: "Product Dark", variant: "active") + ColorContent(color: .productDark, uiColor: .productDark, label: "Product Dark") + ColorContent(color: .productDarkHover, uiColor: .productDarkHover, label: "Product Dark", variant: "hover") + ColorContent(color: .productDarkActive, uiColor: .productDarkActive, label: "Product Dark", variant: "active") } .fixedSize(horizontal: false, vertical: true) - ColorContent(color: &.productDarker, uiColor: &.productDarker, label: "Product Darker") + ColorContent(color: .productDarker, uiColor: .productDarker, label: "Product Darker") .fixedSize(horizontal: false, vertical: true) } } @@ -108,105 +108,105 @@ struct StorybookStatusColors: View { VStack(spacing: 0) { ColorCard(title: "Blue") { HStack(spacing: 0) { - ColorContent(color: &.blueLight, uiColor: &.blueLight, label: "Blue Light") - ColorContent(color: &.blueLightHover, uiColor: &.blueLightHover, label: "Blue Light", variant: "hover") - ColorContent(color: &.blueLightActive, uiColor: &.blueLightActive, label: "Blue Light", variant: "active") + ColorContent(color: .blueLight, uiColor: .blueLight, label: "Blue Light") + ColorContent(color: .blueLightHover, uiColor: .blueLightHover, label: "Blue Light", variant: "hover") + ColorContent(color: .blueLightActive, uiColor: .blueLightActive, label: "Blue Light", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.blueNormal, uiColor: &.blueNormal, label: "Blue Normal") - ColorContent(color: &.blueNormalHover, uiColor: &.blueNormalHover, label: "Blue Normal", variant: "hover") - ColorContent(color: &.blueNormalActive, uiColor: &.blueNormalActive, label: "Blue Normal", variant: "active") + ColorContent(color: .blueNormal, uiColor: .blueNormal, label: "Blue Normal") + ColorContent(color: .blueNormalHover, uiColor: .blueNormalHover, label: "Blue Normal", variant: "hover") + ColorContent(color: .blueNormalActive, uiColor: .blueNormalActive, label: "Blue Normal", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.blueDark, uiColor: &.blueDark, label: "Blue Dark") - ColorContent(color: &.blueDarkHover, uiColor: &.blueDarkHover, label: "Blue Dark", variant: "hover") - ColorContent(color: &.blueDarkActive, uiColor: &.blueDarkActive, label: "Blue Dark", variant: "active") + ColorContent(color: .blueDark, uiColor: .blueDark, label: "Blue Dark") + ColorContent(color: .blueDarkHover, uiColor: .blueDarkHover, label: "Blue Dark", variant: "hover") + ColorContent(color: .blueDarkActive, uiColor: .blueDarkActive, label: "Blue Dark", variant: "active") } .fixedSize(horizontal: false, vertical: true) - ColorContent(color: &.blueDarker, uiColor: &.blueDarker, label: "Blue Darker") + ColorContent(color: .blueDarker, uiColor: .blueDarker, label: "Blue Darker") .fixedSize(horizontal: false, vertical: true) } ColorCard(title: "Red") { HStack(spacing: 0) { - ColorContent(color: &.redLight, uiColor: &.redLight, label: "Red Light") - ColorContent(color: &.redLightHover, uiColor: &.redLightHover, label: "Red Light", variant: "hover") - ColorContent(color: &.redLightActive, uiColor: &.redLightActive, label: "Red Light", variant: "active") + ColorContent(color: .redLight, uiColor: .redLight, label: "Red Light") + ColorContent(color: .redLightHover, uiColor: .redLightHover, label: "Red Light", variant: "hover") + ColorContent(color: .redLightActive, uiColor: .redLightActive, label: "Red Light", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.redNormal, uiColor: &.redNormal, label: "Red Normal") - ColorContent(color: &.redNormalHover, uiColor: &.redNormalHover, label: "Red Normal", variant: "hover") - ColorContent(color: &.redNormalActive, uiColor: &.redNormalActive, label: "Red Normal", variant: "active") + ColorContent(color: .redNormal, uiColor: .redNormal, label: "Red Normal") + ColorContent(color: .redNormalHover, uiColor: .redNormalHover, label: "Red Normal", variant: "hover") + ColorContent(color: .redNormalActive, uiColor: .redNormalActive, label: "Red Normal", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.redDark, uiColor: &.redDark, label: "Red Dark") - ColorContent(color: &.redDarkHover, uiColor: &.redDarkHover, label: "Red Dark", variant: "hover") - ColorContent(color: &.redDarkActive, uiColor: &.redDarkActive, label: "Red Dark", variant: "active") + ColorContent(color: .redDark, uiColor: .redDark, label: "Red Dark") + ColorContent(color: .redDarkHover, uiColor: .redDarkHover, label: "Red Dark", variant: "hover") + ColorContent(color: .redDarkActive, uiColor: .redDarkActive, label: "Red Dark", variant: "active") } .fixedSize(horizontal: false, vertical: true) - ColorContent(color: &.redDarker, uiColor: &.redDarker, label: "Red Darker") + ColorContent(color: .redDarker, uiColor: .redDarker, label: "Red Darker") .fixedSize(horizontal: false, vertical: true) } ColorCard(title: "Green") { HStack(spacing: 0) { - ColorContent(color: &.greenLight, uiColor: &.greenLight, label: "Green Light") - ColorContent(color: &.greenLightHover, uiColor: &.greenLightHover, label: "Green Light", variant: "hover") - ColorContent(color: &.greenLightActive, uiColor: &.greenLightActive, label: "Green Light", variant: "active") + ColorContent(color: .greenLight, uiColor: .greenLight, label: "Green Light") + ColorContent(color: .greenLightHover, uiColor: .greenLightHover, label: "Green Light", variant: "hover") + ColorContent(color: .greenLightActive, uiColor: .greenLightActive, label: "Green Light", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.greenNormal, uiColor: &.greenNormal, label: "Green Normal") - ColorContent(color: &.greenNormalHover, uiColor: &.greenNormalHover, label: "Green Normal", variant: "hover") - ColorContent(color: &.greenNormalActive, uiColor: &.greenNormalActive, label: "Green Normal", variant: "active") + ColorContent(color: .greenNormal, uiColor: .greenNormal, label: "Green Normal") + ColorContent(color: .greenNormalHover, uiColor: .greenNormalHover, label: "Green Normal", variant: "hover") + ColorContent(color: .greenNormalActive, uiColor: .greenNormalActive, label: "Green Normal", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.greenDark, uiColor: &.greenDark, label: "Green Dark") - ColorContent(color: &.greenDarkHover, uiColor: &.greenDarkHover, label: "Green Dark", variant: "hover") - ColorContent(color: &.greenDarkActive, uiColor: &.greenDarkActive, label: "Green Dark", variant: "active") + ColorContent(color: .greenDark, uiColor: .greenDark, label: "Green Dark") + ColorContent(color: .greenDarkHover, uiColor: .greenDarkHover, label: "Green Dark", variant: "hover") + ColorContent(color: .greenDarkActive, uiColor: .greenDarkActive, label: "Green Dark", variant: "active") } .fixedSize(horizontal: false, vertical: true) - ColorContent(color: &.greenDarker, uiColor: &.greenDarker, label: "Green Darker") + ColorContent(color: .greenDarker, uiColor: .greenDarker, label: "Green Darker") .fixedSize(horizontal: false, vertical: true) } ColorCard(title: "Orange") { HStack(spacing: 0) { - ColorContent(color: &.orangeLight, uiColor: &.orangeLight, label: "Orange Light") - ColorContent(color: &.orangeLightHover, uiColor: &.orangeLightHover, label: "Orange Light", variant: "hover") - ColorContent(color: &.orangeLightActive, uiColor: &.orangeLightActive, label: "Orange Light", variant: "active") + ColorContent(color: .orangeLight, uiColor: .orangeLight, label: "Orange Light") + ColorContent(color: .orangeLightHover, uiColor: .orangeLightHover, label: "Orange Light", variant: "hover") + ColorContent(color: .orangeLightActive, uiColor: .orangeLightActive, label: "Orange Light", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.orangeNormal, uiColor: &.orangeNormal, label: "Orange Normal") - ColorContent(color: &.orangeNormalHover, uiColor: &.orangeNormalHover, label: "Orange Normal", variant: "hover") - ColorContent(color: &.orangeNormalActive, uiColor: &.orangeNormalActive, label: "Orange Normal", variant: "active") + ColorContent(color: .orangeNormal, uiColor: .orangeNormal, label: "Orange Normal") + ColorContent(color: .orangeNormalHover, uiColor: .orangeNormalHover, label: "Orange Normal", variant: "hover") + ColorContent(color: .orangeNormalActive, uiColor: .orangeNormalActive, label: "Orange Normal", variant: "active") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { - ColorContent(color: &.orangeDark, uiColor: &.orangeDark, label: "Orange Dark") - ColorContent(color: &.orangeDarkHover, uiColor: &.orangeDarkHover, label: "Orange Dark", variant: "hover") - ColorContent(color: &.orangeDarkActive, uiColor: &.orangeDarkActive, label: "Orange Dark", variant: "active") + ColorContent(color: .orangeDark, uiColor: .orangeDark, label: "Orange Dark") + ColorContent(color: .orangeDarkHover, uiColor: .orangeDarkHover, label: "Orange Dark", variant: "hover") + ColorContent(color: .orangeDarkActive, uiColor: .orangeDarkActive, label: "Orange Dark", variant: "active") } .fixedSize(horizontal: false, vertical: true) - ColorContent(color: &.orangeDarker, uiColor: &.orangeDarker, label: "Orange Darker") + ColorContent(color: .orangeDarker, uiColor: .orangeDarker, label: "Orange Darker") .fixedSize(horizontal: false, vertical: true) } } @@ -219,22 +219,22 @@ struct StorybookBundleColors: View { ColorCard(title: "Bundle") { HStack(spacing: 0) { ColorGradientContent(gradient: .bundleBasic, label: "Bundle Basic") - ColorContent(color: &.bundleBasicStart, uiColor: &.bundleBasicStart, label: "Bundle Basic", variant: "start") - ColorContent(color: &.bundleBasicEnd, uiColor: &.bundleBasicEnd, label: "Bundle Basic", variant: "end") + ColorContent(color: .bundleBasicStart, uiColor: .bundleBasicStart, label: "Bundle Basic", variant: "start") + ColorContent(color: .bundleBasicEnd, uiColor: .bundleBasicEnd, label: "Bundle Basic", variant: "end") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { ColorGradientContent(gradient: .bundleMedium, label: "Bundle Medium") - ColorContent(color: &.bundleMediumStart, uiColor: &.bundleMediumStart, label: "Bundle Medium", variant: "start") - ColorContent(color: &.bundleMediumEnd, uiColor: &.bundleMediumEnd, label: "Bundle Medium", variant: "end") + ColorContent(color: .bundleMediumStart, uiColor: .bundleMediumStart, label: "Bundle Medium", variant: "start") + ColorContent(color: .bundleMediumEnd, uiColor: .bundleMediumEnd, label: "Bundle Medium", variant: "end") } .fixedSize(horizontal: false, vertical: true) HStack(spacing: 0) { ColorGradientContent(gradient: .bundleTop, label: "Bundle Top") - ColorContent(color: &.bundleTopStart, uiColor: &.bundleTopStart, label: "Bundle Top", variant: "start") - ColorContent(color: &.bundleTopEnd, uiColor: &.bundleTopEnd, label: "Bundle Top", variant: "end") + ColorContent(color: .bundleTopStart, uiColor: .bundleTopStart, label: "Bundle Top", variant: "start") + ColorContent(color: .bundleTopEnd, uiColor: .bundleTopEnd, label: "Bundle Top", variant: "end") } .fixedSize(horizontal: false, vertical: true) } @@ -266,38 +266,24 @@ private struct ColorCard: View { private struct ColorContent: View { - let color: UnsafeMutablePointer - let uiColor: UnsafeMutablePointer + let color: Color + let uiColor: UIColor let label: String var variant: String = "" var body: some View { VStack(alignment: .leading, spacing: 0) { - color.pointee + color .frame(maxWidth: .infinity) .frame(height: 88) .overlay( VStack(alignment: .trailing, spacing: 0) { - SwiftUI.Text("\(hexStringFromColor(uiColor.pointee))") + SwiftUI.Text("\(hexStringFromColor(uiColor))") .font(.system(.caption, design: .monospaced).monospacedDigit()) .fontWeight(.medium) - .textColor(uiColor.pointee.brightness > 0.6 ? .inkDark : .whiteNormal) + .textColor(uiColor.brightness > 0.6 ? .inkDark : .whiteNormal) Spacer(minLength: .medium) - - if #available(iOS 14.0, *) { - ColorPicker( - selection: Binding( - get: { color.pointee }, - set: { newColor in - color.pointee = newColor - uiColor.pointee = UIColor(newColor) - } - ) - ) { - EmptyView() - } - } } .padding(.horizontal, .small) .padding(.vertical, .xSmall)