Skip to content

Instantly share code, notes, and snippets.

@krummler
Last active April 20, 2020 10:05
Show Gist options
  • Save krummler/d5d8535c45331e57693778698f4c8413 to your computer and use it in GitHub Desktop.
Save krummler/d5d8535c45331e57693778698f4c8413 to your computer and use it in GitHub Desktop.
let backgroundColor = UIColor {
$0.userInterfaceStyle == .dark ?
UIColor(red: 10.0 / 255, green: 40.0 / 255, blue: 58.0 / 255, alpha: 1) :
UIColor(red: 183.0 / 255, green: 228.0 / 255, blue: 255.0 / 255, alpha: 1)
}
// Or in short:
let borderColour = UIColor {
$0.userInterfaceStyle == .dark ?
UIColor(red: 197.0 / 255, green: 197.0 / 255, blue: 197.0 / 255, alpha: 1) :
UIColor(red: 0, green: 27.0 / 255, blue: 67.0 / 255, alpha: 1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment