Skip to content

Instantly share code, notes, and snippets.

@bermudalocket
Created April 5, 2020 17:56
Show Gist options
  • Save bermudalocket/bc168d2988610c91cf5bbc23ae422b1e to your computer and use it in GitHub Desktop.
Save bermudalocket/bc168d2988610c91cf5bbc23ae422b1e to your computer and use it in GitHub Desktop.
A Color convenience extension to make adaptable UIColors more accessible in SwiftUI.
extension Color {
static let systemRed = Color(UIColor.systemRed)
static let systemGreen = Color(UIColor.systemGreen)
static let systemTeal = Color(UIColor.systemTeal)
static let systemBlue = Color(UIColor.systemBlue)
static let systemYellow = Color(UIColor.systemYellow)
static let systemOrange = Color(UIColor.systemOrange)
static let systemPink = Color(UIColor.systemPink)
static let systemPurple = Color(UIColor.systemPurple)
static let systemIndigo = Color(UIColor.systemIndigo)
static let systemGray = Color(UIColor.systemGray)
static let systemGray1 = Color(UIColor.systemGray2)
static let systemGray3 = Color(UIColor.systemGray3)
static let systemGray4 = Color(UIColor.systemGray4)
static let systemGray5 = Color(UIColor.systemGray5)
static let systemGray6 = Color(UIColor.systemGray6)
static let systemPlaceholderText = Color(UIColor.placeholderText)
static let systemLink = Color(UIColor.link)
static let systemSeparator = Color(UIColor.separator)
static let systemOpaqueSeparator = Color(UIColor.opaqueSeparator)
static let systemLabel = Color(UIColor.label)
static let systemLabelSecondary = Color(UIColor.secondaryLabel)
static let systemLabelTertiary = Color(UIColor.tertiaryLabel)
static let systemLabelQuaternary = Color(UIColor.quaternaryLabel)
static let systemFill = Color(UIColor.systemFill)
static let systemFillSecondary = Color(UIColor.secondarySystemFill)
static let systemFillTertiary = Color(UIColor.tertiarySystemFill)
static let systemFillQuaternary = Color(UIColor.quaternarySystemFill)
static let systemBackground = Color(UIColor.systemBackground)
static let systemBackgroundSecondary = Color(UIColor.secondarySystemBackground)
static let systemBackgroundTertiary = Color(UIColor.tertiarySystemBackground)
static let systemGroupedBackground = Color(UIColor.systemGroupedBackground)
static let systemSecondaryGroupedBackground = Color(UIColor.secondarySystemGroupedBackground)
static let systemTertiaryGroupedBackground = Color(UIColor.tertiarySystemGroupedBackground)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment