可以看看这里:
http://stackoverflow.com/questions/970475/how-to-compare-uicolors
http://stackoverflow.com/questions/970475/how-to-compare-uicolors
解决方案 »
- 关于ASIHttpRequest文件下载时获取到的文件长度不一致问题
- 新手上路--菜鸟求助
- 【iphone扫盲贴】 认识iPhone
- iphone的越狱软件市场有那些?
- AppDelegate 回调用法
- cell上的button做单选,自定义的cell,cell为单独的一个类
- AFN往服务器请求新数据,如果没有新数据,程序就崩掉了
- SDWebImage加载图片,放入deque出来的tabelview中出现的问题
- iOS 使用Platinum实现DLan时,用模拟器会出现提示,用真机什么也搜不到
- apk文件转ipa的转换器
- 如何在其他地方获得self.navigationItem.leftBarButtonItem.title 的title值呢?
- fiddler抓取不到iphone的https请求
取float值判断就可以了
UIColor *color = [[UIColor greenColor] retain]; //line 1//OR(You will have color variable either like line 1 or line 2)color = curView.backgroundColor;//line 2
CGColorRef colorRef = [color CGColor];int _countComponents = CGColorGetNumberOfComponents(colorRef);if (_countComponents == 4) {
const CGFloat *_components = CGColorGetComponents(colorRef);
CGFloat red = _components[0];
CGFloat green = _components[1];
CGFloat blue = _components[2];
CGFloat alpha = _components[3]; NSLog(@"%f,%f,%f,%f",red,green,blue,alpha);
}[color release];