Skip to content

Commit

Permalink
feat: add new dynamic color func for Color
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed May 8, 2021
1 parent 5ce1172 commit 228ee24
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Sources/ExtensionKit/SwiftUI/Color.swift
Expand Up @@ -64,4 +64,13 @@ public extension Color {
? Color(UIColor(red: 1.0-r, green: 1.0-g, blue: 1.0-b, alpha: a))
: .black
}

/// Create a color with a dark and light mode UIColor
/// - Parameters:
/// - light: light color
/// - dark: dark color
/// - Returns: Color
static func dynamicColor(light: UIColor, dark: UIColor) -> Color {
self.init(UIColor.dynamicColor(light: light, dark: dark))
}
}

0 comments on commit 228ee24

Please sign in to comment.