TFTColor
A simple UIColor library to get UIColor object from RGB hex string/value, CMYK hex string/value or CMYK base component values. You can also retrieve back RGB hex string/value, CMYK hex string/value.
Features
- [x] Convert RGB Hex String/Value to UIColor
- [x] Convert CMYK Hex String/Value to UIColor
- [x] Get RGB Hex String/Value from UIColor
- [x] Get CMYK Hex String/Value from UIColor
- [x] Initialize CMYK from its base components
- The beautiful part of this library is that you can input Hex values with
#
,0x
or0X
and the it will take care of this. - Also you can input hex value of any length and this will be handled.
- The library also takes care of non-hex characters.
Supporting Formats for RGB Hex Strings:
- #B
- #BB
- #RGB
- #GGBB
- #RGGBB
- #RRGGBB
Supporting Formats for CMYK Hex Strings:
- #K
- #KK
- #YKK
- #CMYK
- #MYYKK
- #MMYYKK
- #CMMYYKK
- #CCMMYYKK
Requirements
- iOS 8.0+
- Xcode 7.3+
Installation
CocoaPods
You can use CocoaPods to install TFTColor
by adding it to your Podfile
:
Then, run the following command:
Manually
Swift
- Download and drop
TFTColor.swift
in your project.
Objective-C
- Download and drop
TFTColor.h
&TFTColor.m
in your project. - Congratulations!
Usage example
Swift
Objective-C
Contribute
We would love for you to contribute to TFTColor, check the LICENSE
file for more info.