iPhone SDK convert hex color string to UIColor

This function will help you to convert hex color string to UIColor Class.h + (UIColor *) colorWithHexString: (NSString *) stringToConvert; Class.m + (UIColor *) colorWithHexString: (NSString *) stringToConvert{ NSString *cString = [[stringToConvert stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; // String should be 6 or 8 characters if ([cString length] < 6) return [UIColor blackColor]; // strip 0X if… Continue reading iPhone SDK convert hex color string to UIColor