your image color is replaced with red below the code
Your image source code:
UIImageView *image1 =[[UIImageView alloc]initWithFrame:CGRectMake(100, 100, 100, 100)];
[image1 setImage:[UIImage imageNamed:@"Lock.png"]];
[self.view addSubview:image1];
Color Code Rad Color
CGRect rect = CGRectMake(0, 0, image1.frame.size.width, image1.frame.size.height);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextClipToMask(context, rect, [UIImage imageNamed:@"Lock.png"].CGImage);
CGContextSetFillColorWithColor(context, [[UIColor redColor] CGColor]);
CGContextFillRect(context, rect);
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImage *flippedImage = [UIImage imageWithCGImage:img.CGImage
scale:1.0 orientation: UIImageOrientationDownMirrored];
image1.image = flippedImage;
Source image

Color image

source
share