测试已测试 | ✓ |
语言语言 | SwiftSwift |
授权 | MIT |
发布最后发布 | 2016 年 10 月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由 Gabriel Massana 维护。
Swift 扩展,用于将十六进制值转换为 UIColor 对象。
支持的十六进制格式
platform :ios, '8.0'
use_frameworks!
pod 'ColorWithHex', '~> 0.0'
然后,运行以下命令
$ pod install
将 /ColorWithHex-iOS
文件夹拖入您的项目中。就这样。
let shortHexHash: UIColor = UIColor.colorWithHex("#f80")
let shortHex: UIColor = UIColor.colorWithHex("f80")
let hex: UIColor = UIColor.colorWithHex("ff8800")
let hexAlpha: UIColor = UIColor.colorWithHex("ff880080")
let hexHash: UIColor = UIColor.colorWithHex("#20aa45")
let hexHashAlpha: UIColor = UIColor.colorWithHex("#20aa4580")
#import "ColorWithHex-Swift.h"
...
UIColor *shortHexHash = [UIColor cwh_colorWithHex: @"#f80"];
UIColor *shortHex = [UIColor cwh_colorWithHex: @"f80"];
UIColor *hex = [UIColor cwh_colorWithHex: @"ff8800"];
UIColor *hexAlpha = [UIColor cwh_colorWithHex: @"ff880080"];
UIColor *hexAlpha = [UIColor cwh_colorWithHex: @"#20aa45"];
UIColor *hexHash = [UIColor cwh_colorWithHex: @"#20aa4580"];
ColorWithHex-iOS 在 MIT 授权下发布。请参阅名为 LICENSE 的文件。
$ git tag -a 2.0.0 -m 'Version 0.0.0'
$ git push --tags
Gabriel Massana
如果遇到特定于 ColorWithHex-iOS 的问题,或有功能请求,或想分享意见,请在此处新建 问题。