unboxme / Blurberry

Transparent blur using UIVisualEffectView without subclassing
MIT License
56 stars 7 forks source link

Why using .light style? #2

Open r-plus opened 3 years ago

r-plus commented 3 years ago

Hi @unboxme

First, very thanks for your work to research about _UICustomBlurEffect and iOS 14 workaround!

while using Blurberry, I found blured view is little whitey even if blur radius is 0.0 and tintColor is set to .clear

That is caused using .light style for base effect in this line https://github.com/unboxme/Blurberry/blob/0.1.0/Sources/Views/VisualEffectView+Internal.swift#L79

I try to change to simple init like this base.effect = UIBlurEffect() then truely same color when blur radius is 0.

And, this is also for no longer need set tintColor to .clear for removing whitey purpose.

This is screenshot of before and after. (under the black border is UIVisualEffectView)

before (using .light) after (using .init())
スクリーンショット 2020-12-28 17 11 09 スクリーンショット 2020-12-28 17 10 12

Refs: tested project: https://github.com/r-plus/BlurberryTest

unboxme commented 3 years ago

@r-plus Thank you for using my library and sorry for the late reply.

Unfortunately this solution has a one limitation — after that you couldn't set tintColor. But there's a good news, that it fixes an over-saturated blur.

I am researching this issue.