ColorWithHSV 1.0.2

ColorWithHSV 1.0.2

测试已测试
语言语言 SwiftSwift
许可证 MIT
发布最新版本2016年4月
SPM支持 SPM

Gabriel Massana 维护。



  • 作者:
  • Gabriel Massana

ColorWithHSV-iOS

它是做什么的?

将 HSV 颜色值转换为 UIColor 对象的 Swift 扩展。

HSV 表示色调、饱和度和亮度,也常称为 HSB(B 代表亮度)。

公式来自 维基百科

安装

Podfile

platform :ios, '8.0'
use_frameworks!

pod 'ColorWithHSV', '~> 0.0'

然后,运行以下命令:

$ pod install

老方法

/ColorWithHSV-iOS 文件夹拖动到项目中。这样就完成了。

Swift 示例

        let black: UIColor = UIColor.colorWithHSV(hue: 0.0, saturation: 0.0, value: 0.0)
        let white: UIColor = UIColor.colorWithHSV(hue: 0.0, saturation: 0.0, value: 1.0)
        let red: UIColor = UIColor.colorWithHSV(hue: 0.0, saturation: 1.0, value: 1.0)
        let green: UIColor = UIColor.colorWithHSV(hue: 120.0, saturation: 1.0, value: 1.0)
        let blue: UIColor = UIColor.colorWithHSV(hue: 240.0, saturation: 1.0, value: 1.0)

Objective-C 示例

#import "ColorWithHSV-Swift.h"

...
    UIColor *black = [UIColor hsv_colorWithHue:0.0 saturation:0.0 value:0.0];
    UIColor *white = [UIColor hsv_colorWithHue:0.0 saturation:0.0 value:1.0];
    UIColor *red = [UIColor hsv_colorWithHue:0.0 saturation:1.0 value:1.0];
    UIColor *green = [UIColor hsv_colorWithHue:120.0 saturation:1.0 value:1.0];
    UIColor *blue = [UIColor hsv_colorWithHue:240.0 saturation:1.0 value:1.0];

许可证

ColorWithHSV-iOS 在 MIT 许可证下发布。请参阅名为 LICENSE 的文件。

版本

$ git tag -a 1.0.0 -m 'Version 1.0.0'

$ git push --tags

作者

Gabriel Massana

发现了一个问题?

如果您遇到与 ColorWithHSV-iOS 相关的具体问题,或者有功能请求,或者想分享评论,请在以下位置创建新问题: 这里