0

All,

We have icon design from PhotoShop, It is Square transparent image with a Polygon inside which has a blue color. Based on some conditions i want to change the Polygon color but on the complete image color. Can we do this in code (Objective C)

enter image description here

I am attaching a Image in which the Only background "blue" color need to be changed based on the color we give. How can we achevie that

kiri
  • 1,977
  • 5
  • 27
  • 55
  • Check this https://stackoverflow.com/a/36475407/7250862 – RajeshKumar R Sep 27 '17 at 08:29
  • Yes, In Objective C we have a provision to change the icons colors which are transparently rendered. Here is the procedure https://stackoverflow.com/questions/41545599/how-to-change-tintcolor-of-image-in-uibutton-with-imageedgeinsets/41547471#41547471 – Vishnuvardhan Sep 27 '17 at 08:23

1 Answers1

0

You can do this by rendering the image in UIImageRenderingModeAlwaysTemplate mode & after that set tintColor.

imageView.image = [imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[imageView setTintColor:[UIColor redColor]];
Lal Krishna
  • 15,485
  • 6
  • 64
  • 84