Skip to content

Commit

Permalink
Updates the DRK to add a single use color
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed Dec 20, 2024
1 parent 8449a35 commit ba2f7e2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources/DesignResourcesKit/Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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
}
}

0 comments on commit ba2f7e2

Please sign in to comment.