Base Colors
public struct Colors {
public static let blue1 = UIColor(red: 0.0, green: 0.0, blue: 1.0, alpha: 1.0)
public static let blue2 = UIColor(red: 0.0, green: 0.4, blue: 1.0, alpha: 1.0)
public static let blue3 = UIColor(red: 0.1, green: 0.0, blue: 1.0, alpha: 1.0)
public static let blue4 = UIColor(red: 0.2, green: 0.2, blue: 1.0, alpha: 1.0)
}
Semantic Names
extension Colors {
public static var navbarBlue: UIColor { return Colors.blue1 }
public static var subnavBlue: UIColor { return Colors.blue3 }
}
Example Usage
view.backgroundColor = Colors.navbarBlue
Class specific colors
@IBDesignable class SomeView: UIView {
...
struct Colors {
static let foregroundBlue = SomeProject.Colors.blue2
}
...
}