0

I'd like to present a UIView above a UIImageView, which gets its color dynamically, according to the UIImageView's average background color.

Although I did find some good solutions for getting the average color of an image, I could not figure out how to find the average color of a sub area of a UIImageView, which presents that image (as the image size is not necessarily equal to the view size).

Any idea how can such thing be achieved? I thought of adding a method which does that as a Category of UIImageView. Maybe something like:

- (UIColor *)averageColorForArea:(CGRect)area;
ofer2980
  • 464
  • 5
  • 26
  • Despite the misleading question title, @NicolaGiancecchi's linked question has the answer you are looking for. – Andrew Feb 28 '16 at 22:56
  • @SantaClaus/@NicolaGiancecchi - thanks for your help! I'm just still not sure - how I apply this technic to specific are in the the ImageView? (Sorry, I don't have much experience in this field...) – ofer2980 Feb 29 '16 at 12:23

0 Answers0