码迷,mamicode.com
首页 > 编程语言 > 详细

swift material

时间:2014-12-29 08:54:07      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:

import UIKit

extension UIColor {

  convenience init(hex:Int, alpha:CGFloat=1.0) {

    let red = CGFloat((hex & 0xFF0000) >> 16)/255.0

    let green = CGFloat((hex & 0xFF00) >> 8) /255.0

    let blue = CGFloat ((hex &0xFF))/255.0

    self.init(red:red, green:green, blue:blue, alpha:alpha)

  }  

 

  struct MKColor {

    static let Red = UIColor(hex : 0xF44336)

    static let Ping = UIColor(hex:0xE91E63)

  }

}

swift material

标签:

原文地址:http://www.cnblogs.com/yushunwu/p/4190972.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!