Skip to content

Instantly share code, notes, and snippets.

@efremidze
Last active December 15, 2017 00:30
Show Gist options
  • Save efremidze/8a6e06bf89df453bafc71dabb96459c8 to your computer and use it in GitHub Desktop.
Save efremidze/8a6e06bf89df453bafc71dabb96459c8 to your computer and use it in GitHub Desktop.
extension UIColor {
convenience init(red: Int, green: Int, blue: Int) {
self.init(red: CGFloat(red) / 255, green: CGFloat(green) / 255, blue: CGFloat(blue) / 255, alpha: 1)
}
class var red: UIColor { return UIColor(red: 255, green: 59, blue: 48) }
class var orange: UIColor { return UIColor(red: 255, green: 149, blue: 0) }
class var yellow: UIColor { return UIColor(red: 255, green: 204, blue: 0) }
class var green: UIColor { return UIColor(red: 76, green: 217, blue: 100) }
class var tealBlue: UIColor { return UIColor(red: 90, green: 200, blue: 250) }
class var blue: UIColor { return UIColor(red: 0, green: 122, blue: 255) }
class var purple: UIColor { return UIColor(red: 88, green: 86, blue: 214) }
class var pink: UIColor { return UIColor(red: 255, green: 45, blue: 85) }
class var all: [UIColor] { return [red, orange, yellow, green, tealBlue, blue, purple, pink] }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment