UIColor-HexUtils 1.1

UIColor-HexUtils 1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release May 2016

Maintained by Carlos Alcala.



UIColor+HexUtils

UIColor+HexUtils is a category for Hexadecimal Colors Support for UIColor. Support for prefixed # (#FFFFFF) or without (FFFFFF) Hexadecimal Colors.

RELEASE 1.0

The base UIColor+Hex category with the required hex transformation functions.

Examples

Objective-c

// with hash
UIColor *colorHash = [UIColor colorWithHex:@"#FFFFFF"];

// without hash
UIColor *colorNoHash = [UIColor colorWithHex:@"FFFFFF"];

// short Hex
UIColor *colorShort = [UIColor colorWithHex:@"#FFF"];

swift

// with hash
let colorHash = UIColor.colorWithHex("#FFFFFF")

// without hash
let colorNoHash = UIColor.colorWithHex("FFFFFF")

// short Hex
let colorShort = UIColor.colorWithHex("#FFF")

Installation

  • #import "UIColor+HexUtils.h" where you want to use UIColor+HexUtils category functions
  • pod install UIColor+HexUtils
  • or just drag the source files in your project

Requirements

UIColor+HexUtils requires iOS 5.0 and above.

Credits

UIColors+Hex was created by Carlos Alcala because I was using in a lot of projects and wanted to contribute (and avoid the pain to always search for this functionality).

Creator

Carlos Alcala @carlosalcala

License

UIColors+Hex is available under the MIT license. See the LICENSE file for more info.