I\'m making a drawing app and I would like to refer to my colors through use of an enum. For example, it would be cleaner and more convenient to use Colors.RedColor
Colors.RedColor
This can be done much more succinctly (and should):
extension UIColor { static let myColor = UIColor(displayP3Red: 0.0, green: 0.7, blue: 0.0, alpha: 1.0) }
(Any other method that returns a UIColor is equally suitable, doesn't need to be displayP3Red)
displayP3Red
Usage:
let someColor: UIColor = .myColor