0

I have a problem concerning an icon:

I have an icon (with transparency), which is black. For different uses I want to color it to blue (for example). Originally the icon was made to fit a UITabbar. There the color of the shape is colored to blue as well, when selected.
This is what I want to reach. Has anyone a possible solution?

Thanks!

Lars Petersen
  • 602
  • 9
  • 21

1 Answers1

0

Sounds like you want to do a color blend. My fork of MGImageUtilities should provide what you want. It can take your black icon and color all the visible pixels blue without affecting the alpha channel.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347
  • That's exactly what I need. But there is only one problem. I can not blend my image to white (to use it in a UIBarbuttonItem). I don't know why, but your UIImage does only blend a thin border of the shape without affecting the fill color. – Lars Petersen Dec 06 '10 at 21:01
  • Ah, I know what your issue is. It's keeping the brightness of the original image while using the color that you specify. In other words, it's doing a real tint. You can either convert your image to be all white (or to have some actual brightness that means something), or you can use Matt Gemmell's [original version](https://github.com/mattgemmell/MGImageUtilities), which ignores the brightness of the image. – Lily Ballard Dec 07 '10 at 00:04