TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2016 |
SPMSupports SPM | ✗ |
Maintained by Gabriel Massana.
Swift Extension to convert a HSV colour values into a UIColor Objects.
HSV stands for hue, saturation, and value, and is also often called HSB (B for brightness).
Formula from Wikipedia.
platform :ios, '8.0'
use_frameworks!
pod 'ColorWithHSV', '~> 0.0'
Then, run the following command:
$ pod install
Drag into your project the folder /ColorWithHSV-iOS
. That’s all.
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)
#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 is released under the MIT license. Please see the file called LICENSE.
$ git tag -a 1.0.0 -m 'Version 1.0.0'
$ git push --tags
Gabriel Massana
Please open a new Issue here if you run into a problem specific to ColorWithHSV-iOS, have a feature request, or want to share a comment.