Neo-J
9/18/2014 - 3:03 AM

WebColor to UIColor

WebColor to UIColor

+ (UIColor *)colorFromHexString:(NSString *)hexString {
   unsigned rgbValue = 0;
    NSScanner *scanner = [NSScannerscannerWithString:hexString];
    [scanner setScanLocation:1];// bypass '#' character
    [scannerscanHexInt:&rgbValue];
   return [UIColorcolorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:1.0];
}