UIColor extension for RGB Hex in Swift
Written on:July 22, 2014
0
We had a great boot camp this weekend at the Dallas iOS Swift Boot Camp! One question was how to make a UIColor from a hex value. I personally think hex colors are so much easier to deal with. Here is the little gem for you in swift: import UIKit extension UIColor { class func colorWithRGBHex(hex: Int, alpha: Float = 1.0) -> UIColor { let r = Float((hex >> 16)…
Read more...