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)

  }

}

相关文章:

  • 2021-08-14
  • 2022-02-17
  • 2022-02-21
  • 2022-01-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-11
  • 2021-10-06
  • 2021-11-17
相关资源
相似解决方案