CGFloat * colors = CGColorGetComponents ( hsbaColor . CGColor )
如:
UIColor *color = [UIColor colorWithRed:0.0 green:0.0 blue:1.0alpha:1.0];
const CGFloat *components =CGColorGetComponents(color.CGColor);
NSLog(@"Red: %f", components[0]);
NSLog(@"Green: %f", components[1]);
NSLog(@"Blue: %f", components[2]);
摘自:https://blog.csdn.net/xiaojian2314/article/details/20538701
网友评论