SwiftColorsUIColor 扩展

联合创作 · 2023-09-27

SwiftColors 是 HEX 颜色处理工具,作为 UIColor 的扩展,使用 Swift 编写。

示例:

// Most simple way
let colorFromInt: UIColor = 0x3ab976

// With hash
let color: UIColor = UIColor(hexString: "#ff8942")

// Without hash, with alpha
let secondColor: UIColor = UIColor(hexString: "ff8942", alpha: 0.5)

// Short handling
let shortColorWithHex: UIColor = UIColor(hexString: "fff")

 

浏览 1
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报