Whilst the code below worked previously, it has stopped working in Xcode 8 Beta 4, presumably because the components
return was a very un-Swift-y C-array of floats,
extension UIColor {
var all4Components:(red:CGFloat, green:CGFloat, blue: CGFloat, alpha:CGFloat) {
let components = self.cgColor.components!
let red = components[0]
let green = components[1]
let blue = components[2]
let alpha = components[3]
return (red:red, green:green, blue: blue, alpha:alpha)
}
}