该方法把转入来的UIColor对像转化为RGB对应颜色值输出,大小在0-1之间
-(RGBValue)readRGBForUIColor:(UIColor*)color{
const CGFloat *components = CGColorGetComponents(color.CGColor);
Byte b = components[2] * 255;
Byte g = components[1] * 255;
Byte r = components[0] * 255;
RGBValue rgb;
rgb.blue = b;
rgb.green = g;
rgb.red = r;
NSLog(@"red:%x\ngreen:%x\nblue:%x",r,g,b);
return rgb;
}