Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import UIKit
extension UIColor: IntegerLiteralConvertible {
class func convertFromIntegerLiteral(value: IntegerLiteralType) -> UIColor {
let r = Double((value >> 16) & 0xFF) / 255;
let g = Double((value >> 8) & 0xFF) / 255;
let b = Double((value) & 0xFF) / 255;
return UIColor(red:r, green:g, blue:b, alpha:1.0)
}
}
let white: UIColor = 0xFFFFFF
let blue: UIColor = 0x0000ff
let geniusOrange: UIColor = 0xFFC31C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.