/生成采样对照颜色(黑色)
UIColor* sampleColor = [UIColor colorWithRed:(0/255.0f) green:(0/255.0f) blue:(0/255.0f) alpha:(255/255.0f)];
//比较 if (CGColorEqualToColor(detectedColor.CGColor, sampleColor.CGColor))
{
//处理
}
/生成采样对照颜色(黑色)
UIColor* sampleColor = [UIColor colorWithRed:(0/255.0f) green:(0/255.0f) blue:(0/255.0f) alpha:(255/255.0f)];
//比较 if (CGColorEqualToColor(detectedColor.CGColor, sampleColor.CGColor))
{
//处理
}
转载于:https://www.cnblogs.com/rollrock/p/3905601.html