KGNColor
is a collection of helpful UIColor
extensions.
github "kgn/KGNColor"
pod 'KGNColor'
Using a hex value is often the easiest way to use the exact color from a design.
let tintColor = UIColor(hex: 0x2DFF5F)
Used this helpful tuple to get the red
, green
, blue
and alpha
values of a UIColor
.
let tintColor = UIColor.brown
print("red: \(tintColor.components.red)")
print("green: \(tintColor.components.green)")
print("blue: \(tintColor.components.blue)")
print("alpha: \(tintColor.components.alpha)")
let tintColor = UIColor.red.inverted
let tintColor = UIColor.blue.lighten(0.5)
let tintColor = UIColor.green.darken(0.5)