Last active
December 26, 2022 14:16
-
-
Save mdb1/2334c5f872223a514be8d32a9a1461fd to your computer and use it in GitHub Desktop.
Color Extension SwiftUI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
/// Namespaces. | |
extension Color { | |
/// Colors for Texts. | |
enum Text {} | |
/// Colors for Backgrounds | |
enum Background {} | |
/// Colors for Borders. | |
enum Border {} | |
} | |
// MARK: - General Colors | |
extension Color { | |
static let appPrimary = Color("appPrimary") | |
static let appSecondary = Color("appSecondary") | |
} | |
// MARK: - Text Colors | |
extension Color.Text { | |
static let primary = Color("textPrimary") | |
} | |
// MARK: - Background Colors | |
extension Color.Background { | |
static let primary = Color("backgroundPrimary") | |
} | |
// MARK: - Border Colors | |
extension Color.Border { | |
static let `default` = Color("border") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment