Joined April 2014
·

Damon Qin

Shenzhen, China
·
·

Posted to HEX colors in Swift over 1 year ago

I had wrote a extension of UIColor:
https://github.com/DamonQin/CommonExtensionCollection-Swift.
It can also adapt to Hex Value like "#333" or "333".

Usage:
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.

Achievements
30 Karma
0 Total ProTip Views
Interests & Skills