"Design is a plan for arranging elements in such a way as best to accomplish a particular purpose" — Charles Eames

UIColor+ColorWithHex is a category method for iOS UIColor, inspired by the lack of hexadecimal colour integration of iOS.

UIColor+ColorWithHex Download Link

GitHub

Sample Usage:

[[self view] setBackgroundColor: [UIColor colorWithHex: 0xff0000]];

UIColor *randomColor = [UIColor randomColor];

Methods:

+ (UIColor *)colorWithHex:(UInt32)hexadecimal;
+ (UIColor *)colorWithHexString:(NSString *)hexadecimal;
+ (UIColor *)colorWithAlphaHex:(UInt32)hexadecimal;
+ (UIColor *)colorWithAlphaHexString:(NSString *)hexadecimal;
+ (NSString *)hexStringFromColor: (UIColor *)color;
+ (UIColor *)randomColor;
// ObjC (manual hex conversion to RGB)
+ (UIColor *)colorWithHexa:(NSString *)hexadecimal;

Pages

Copyright © 2010 - 2013 Studio Villegas. All Rights Reserved.