CGFloat hue;
CGFloat saturation;
CGFloat brightness;
CGFloat alpha;
[aColor getHue:&hue
saturation:&saturation
brightness:&brightness
alpha:&alpha];
getHue:saturation:brightness:alpha: returns a boolean value indicating whether the UIColor could be converted at all.
Example:
BOOL b = [[UIColor colorWithRed:.23 green:.42 blue:.9 alpha:1.0] getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
NSLog(@"%f %f %f %f %d", hue, saturation, brightness, alpha, b);
will record 0.619403 0.744444 0.900000 1.000000 1how it really
while
BOOL b = [[UIColor colorWithPatternImage:[UIImage imageNamed:@"pattern.png"]] getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha];
NSLog(@"%f %f %f %f %d", hue, saturation, brightness, alpha, b);
magazines 0.000000 0.000000 -1.998918 0.000000 0. The last 0 is Bool, so this is unacceptable, and in fact brightness can only range from 0.0 to 1.0, but here it contains some random nonsense.
Conclusion
The code should be something like
CGFloat hue;
CGFloat saturation;
CGFloat brightness;
CGFloat alpha;
if([aColor getHue:&hue saturation:&saturation brightness:&brightness alpha:&alpha]){
} else {
}