Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get blurry dominant image color on like Snapguide

Tags:

ios

swift

xcode6

I'm looking to achieve an effect like this one in Snapguide:

Snapguide image colors

They are getting main image color and blurring (not sure, but I looks like they are) it somehow. I think I saw somewhere that there is a similar option available in iOS 8, but I couldn't find it anywhere. So does anyone know how they do it, or how can I get a similar effect?

Also to note, I'm working on new Xcode for iOS 7 & 8 in Swift, but I don't think that matters much.

like image 336
Stefan Salatic Avatar asked Mar 18 '23 14:03

Stefan Salatic


1 Answers

To extract the dominant image color, check out ColorArt.

Once you get the dominant color, try setting the tint color of a UIVisualEffectView to the required color. Init the VisualEffectView with a UIBlurEffect.

let blur = UIVisualEffectView(effect: UIBlurEffect(style: UIBlurEffectStyle.Light))
blur.tintColor = /* yourColor */
blur.frame = view.frame
view.addSubview(blur)
like image 132
aksh1t Avatar answered Apr 01 '23 04:04

aksh1t