I have a condition in my app where user can choose 3 colors, but those colors should not match with each other, the problem is user can choose the similar color from the pal
If I understood clearly :
CGFloat *components1 = CGColorGetComponents([[UIColor color1] CGColor]);
CGFloat *component1 = CGColorGetComponents([[UIColor color2] CGColor]);
Then, you can compare the difference between the two colors using components[0] (red),components[1] (green), components[2] (blue) and components[3] alpha.
Decide what you wanna compare. Example :
fabs(components1[1]-components2[1]), or a mean between all theses differences, etc.