#T23Kit-Colour UIColor Category with various colourspace transformations, neighbourhood colour generations, and ∆-E metrics.
##Discussion
Currently there are three pieces to this library:
- UIColor conversions to non-standard colour spaces
- UIColor neighbourhood colour generations
- UIColor distance (∆-E) metrics
###Colour Conversions
Below are the currently supported colourspace conversions:
- RYB (Only from RYB)
- CIE XYZ 1
- Hunter 1948 (L, a, b)
- CIE 1976 (L*, a*, b*)
- CIE 1976 (L*, u*, v*)
- CIE 1976 (L*, C*, H*ab)
- CIE 1976 (L*, C*, H*uv)
- CMYK
- HSL
- HSI
Note: Please see UIColor+T23ColourSpaces.h for the format of values that are returned.
1 The default currently uses the sRGB working matrices for converting to/from XYZ space. Please see rgb_working_matrices in colourspaces.c for more detail ###Neighbourhood Colour Generations Below are the currently supported neighbourhood generations
- Triadic
- Split Complements
- Analogous
- Complementary
Note: Please see EasyRGB's definition of these neighbourhoods. ###Colour Distance Formulas (∆-E) Below are the currently supported colour distance metrics
- CIE76
- CIE94
- CIEDE2000
- CMC l:c (1984)
Note: Please see Wikipedia for more information regarding ∆-E
##API
UIColor+T23ColourSpaces
+ (UIColor *)colorWithRed:yellow:blue:alpha:
+ (UIColor *)colorWithHexString:alpha:
- (UIColor *)initWithRed:yellow:blue:alpha:
- (UIColor *)initWithHexString:alpha:
- (NSString *)hexString
- (BOOL)getX:Y:Z:alpha:
- (BOOL)getHunterLStar:aStar:bStar:alpha:
- (BOOL)getLStar:aStar:bStar:alpha:
- (BOOL)getLStar:uStar:vStar:alpha:
- (BOOL)getLStar:cStar:hStarAB:alpha:
- (BOOL)getLStar:cStar:hStarUV:alpha:
- (BOOL)getCyan:magenta:yellow:black:alpha:
- (BOOL)getHue:saturation:lightness:alpha:
- (BOOL)getHue:saturation:intensity:alpha:
- (NSArray *)getTriadic
- (NSArray *)getSplitComplements
- (NSArray *)getAnalogous
- (UIColor *)getComplement
- (CGFloat)getDistanceMetricBetweenUIColor:withOptions:
UIColor Swift Extension
- init(red: CGFloat, yellow: CGFloat, blue: CGFloat, alpha: CGFloat)
- init(hexString: String, alpha: CGFloat)
- var hue:CGFloat { get }
- var saturation:CGFloat { get }
- var brightness:CGFloat { get }
- var red:CGFloat { get }
- var green:CGFloat { get }
- var blue:CGFloat { get }
- var alpha:CGFloat { get }
- var hexString:String { get }
- func getHSB() -> HSB
- func getRGB() -> RGB
- func getXYZ() -> XYZ
- func getHLAB() -> HLAB
- func getLAB() -> LAB
- func getLUV() -> LUV
- func getLCHab() -> LCHab
- func getLCHuv() -> LCHuv
- func getCMYK() -> CMYK
- func getHSI() -> HSI
- func getHSL() -> HSL
- func getTriadic() -> (thisColor: UIColor, right: UIColor, left: UIColor)
- func getSplitCompliments() -> (thisColor: UIColor, right: UIColor, left: UIColor)
- func getAnalogous() -> (thisColor: UIColor, right: UIColor, left: UIColor)
- func getCompliment() -> UIColor
- func getDistanceBetweenUIColor(compare: UIColor, options: ColourDistanceOptions) -> CGFloat
##Setup
###Objective-C:
#####Using CocoaPods:
- Add the pod
T23Kit-Colour
to your Podfile.
pod 'T23Kit-Colour'
- Run
pod install
from Terminal, then open your app's.xcworkspace
file to launch Xcode. #import "UIColor+T23ColourSpaces.h"
wherever you want to use the API.
#####Manually from GitHub
- Download the source files in the T23Kit-Colour Source directory.
- Add files to your Xcode project.
#import "UIColor+T23ColourSpaces.h"
wherever you want to use the API.
###Swift:
#####Using CocoaPods:
CocoaPods aren't supported yet but this project will update as soon as CocoaPods irons it all out.
#####Manually from GitHub
- Download the source files in the T23Kit-Colour Source directory.
- Add
Colour.swift
to your Xcode project.
##Examples
If you would like to see an example of this library in use check out our other toy project ColorPalette.
##Releases
Releases are tagged in the git commit history using (mostly) semantic versioning. Check out the releases and release notes for each version.
Designed & maintained by Thirteen23 Developers. Distributed with the MIT license.