iwill iwill - 1 year ago 106
Objective-C Question

How to get inverse color from UIColor?

e.g. The inverse color from black should be white.

Answer Source


-(UIColor*) inverseColor
    CGFloat r,g,b,a;
    [self getRed:&r green:&g blue:&b alpha:&a];
    return [UIColor colorWithRed:1.-r green:1.-g blue:1.-b alpha:a];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download