diff --git a/Color/UIColor+Expanded.m b/Color/UIColor+Expanded.m index 22e9465..157170a 100644 --- a/Color/UIColor+Expanded.m +++ b/Color/UIColor+Expanded.m @@ -1165,7 +1165,14 @@ + (UIColor *) colorWithString: (NSString *)stringToConvert CGFloat c[kMaxComponents]; NSUInteger i = 0; - if (![scanner scanFloat: &c[i++]]) return nil; + if( 4 == sizeof( CGFloat)) + { + if (![scanner scanFloat: &c[i++]]) return nil; + } + else + { + if (![scanner scanDouble: &c[i++]]) return nil; + } while (1) { @@ -1173,7 +1180,14 @@ + (UIColor *) colorWithString: (NSString *)stringToConvert if (i >= kMaxComponents) return nil; if ([scanner scanString:@"," intoString:NULL]) { - if (![scanner scanFloat: &c[i++]]) return nil; + if( 4 == sizeof( CGFloat)) + { + if (![scanner scanFloat: &c[i++]]) return nil; + } + else + { + if (![scanner scanDouble: &c[i++]]) return nil; + } } else {