Joined April 2014

Damon Qin

Shenzhen, China

Posted to HEX colors in Swift over 1 year ago

I had wrote a extension of UIColor:
It can also adapt to Hex Value like "#333" or "333".

self.testButton.backgroundColor = UIColor.hexValue("323")
self.testButton.backgroundColor = UIColor.hexValue("#323")
self.testButton.setTitleColor(UIColor.hexValueWithAlpha("ffffff", alpha: 1.0), forState: UIControlState.Normal)

May you like this repo. Thx.

30 Karma
0 Total ProTip Views
Interests & Skills