TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2016 |
SPMSupports SPM | ✗ |
Maintained by Gabriel Massana.
Swift Extension to convert a HSL colour values into a UIColor Objects.
HSL stands for hue, saturation, and lightness, and is also often called HLS.
Formula from Wikipedia.
platform :ios, '8.0'
use_frameworks!
pod 'ColorWithHSL', '~> 0.0'
Then, run the following command:
$ pod install
Drag into your project the folder /ColorWithHSL-iOS
. That’s all.
let black: UIColor = UIColor.colorWithHSL(hue: 0.0, saturation: 0.0, lightness: 0.0)
let white: UIColor = UIColor.colorWithHSL(hue: 0.0, saturation: 0.0, lightness: 1.0)
let red: UIColor = UIColor.colorWithHSL(hue: 0.0, saturation: 1.0, lightness: 0.5)
let green: UIColor = UIColor.colorWithHSL(hue: 120.0, saturation: 1.0, lightness: 0.5)
let blue: UIColor = UIColor.colorWithHSL(hue: 240.0, saturation: 1.0, lightness: 0.5)
#import "ColorWithHSL-Swift.h"
...
UIColor *black = [UIColor hsl_colorWithHue:0.0 saturation:0.0 lightness:0.0];
UIColor *white = [UIColor hsl_colorWithHue:0.0 saturation:0.0 lightness:1.0];
UIColor *red = [UIColor hsl_colorWithHue:0.0 saturation:1.0 lightness:0.5];
UIColor *green = [UIColor hsl_colorWithHue:120.0 saturation:1.0 lightness:0.5];
UIColor *blue = [UIColor hsl_colorWithHue:240.0 saturation:1.0 lightness:0.5];
ColorWithHSL-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 ColorWithHSL-iOS, have a feature request, or want to share a comment.