// Returns a UIColor by scanning the string for a hex number and passing that to +[UIColor colorWithRGBHex:]// Skips any leading whitespace and ignores any trailing characters
+ (UIColor *)colorWithHexString:(NSString *)stringToConvert {
NSScanner *scanner = [NSScanner scannerWithString:stringToConvert];
unsigned hexNum;
if (![scanner scanHexInt:&hexNum]) returnnil;
return [UIColor colorWithRGBHex:hexNum];
}