可以看看这里: 
http://stackoverflow.com/questions/970475/how-to-compare-uicolors

解决方案 »

  1.   

    CGFloat *CGColorGetComponents(CGColorRef color) 
    取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];
      

  2.   

    你直接用UIColor的isEqual方法试试,应该可以的