From 8449a35fd8c340fea4f837e2ebd19635cdd49d50 Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Wed, 18 Dec 2024 13:48:14 -0300 Subject: [PATCH 1/2] Updates DRK --- Sources/DesignResourcesKit/Color.swift | 2 + .../textLink.colorset/Contents.json | 38 +++++++++++++++++++ .../textSelectionFill.colorset/Contents.json | 38 +++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 Sources/DesignResourcesKit/Colors.xcassets/textLink.colorset/Contents.json create mode 100644 Sources/DesignResourcesKit/Colors.xcassets/textSelectionFill.colorset/Contents.json diff --git a/Sources/DesignResourcesKit/Color.swift b/Sources/DesignResourcesKit/Color.swift index 052cf5e..02804ac 100644 --- a/Sources/DesignResourcesKit/Color.swift +++ b/Sources/DesignResourcesKit/Color.swift @@ -27,8 +27,10 @@ public enum DesignSystemColor: String { case backgroundSheets case surface case container + case textLink case textPrimary case textSecondary + case textSelectionFill case lines case accent case icons diff --git a/Sources/DesignResourcesKit/Colors.xcassets/textLink.colorset/Contents.json b/Sources/DesignResourcesKit/Colors.xcassets/textLink.colorset/Contents.json new file mode 100644 index 0000000..5703f0a --- /dev/null +++ b/Sources/DesignResourcesKit/Colors.xcassets/textLink.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xEF", + "green" : "0x69", + "red" : "0x39" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xF6", + "green" : "0x95", + "red" : "0x72" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Sources/DesignResourcesKit/Colors.xcassets/textSelectionFill.colorset/Contents.json b/Sources/DesignResourcesKit/Colors.xcassets/textSelectionFill.colorset/Contents.json new file mode 100644 index 0000000..47a8218 --- /dev/null +++ b/Sources/DesignResourcesKit/Colors.xcassets/textSelectionFill.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.200", + "blue" : "0xEF", + "green" : "0x69", + "red" : "0x39" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "0.200", + "blue" : "0xF6", + "green" : "0x95", + "red" : "0x72" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} From ba2f7e26575a9529ce268ce16f01760187649ce6 Mon Sep 17 00:00:00 2001 From: Diego Rey Mendez Date: Fri, 20 Dec 2024 11:05:09 -0300 Subject: [PATCH 2/2] Updates the DRK to add a single use color --- Sources/DesignResourcesKit/Color.swift | 14 +++++++ .../Contents.json | 38 +++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Sources/DesignResourcesKit/Colors.xcassets/SingleUseExceptionsNotPartOfTheDesignSystem/controlWidgetBackground.colorset/Contents.json diff --git a/Sources/DesignResourcesKit/Color.swift b/Sources/DesignResourcesKit/Color.swift index 02804ac..9c5e171 100644 --- a/Sources/DesignResourcesKit/Color.swift +++ b/Sources/DesignResourcesKit/Color.swift @@ -41,10 +41,20 @@ public enum DesignSystemColor: String { case buttonsSecondaryFillPressed } +/// When used multiple times, we should propose that these are promoted do design system. +/// +public enum SingleUserColor: String { + case controlWidgetBackground +} + public extension Color { init(designSystemColor: DesignSystemColor) { self.init(designSystemColor.rawValue, bundle: bundle) } + + init(singleUseColor: SingleUserColor) { + self.init(singleUseColor.rawValue, bundle: bundle) + } } #if canImport(UIKit) @@ -55,6 +65,10 @@ public extension UIColor { convenience init(designSystemColor: DesignSystemColor) { self.init(named: designSystemColor.rawValue, in: bundle, compatibleWith: nil)! } + + convenience init(singleUseColor: SingleUserColor) { + self.init(named: singleUseColor.rawValue, in: bundle, compatibleWith: nil)! + } } #endif diff --git a/Sources/DesignResourcesKit/Colors.xcassets/SingleUseExceptionsNotPartOfTheDesignSystem/controlWidgetBackground.colorset/Contents.json b/Sources/DesignResourcesKit/Colors.xcassets/SingleUseExceptionsNotPartOfTheDesignSystem/controlWidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..56e647d --- /dev/null +++ b/Sources/DesignResourcesKit/Colors.xcassets/SingleUseExceptionsNotPartOfTheDesignSystem/controlWidgetBackground.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x87", + "green" : "0x83", + "red" : "0x81" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x87", + "green" : "0x83", + "red" : "0x81" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}