widget alpha tweak fix
This commit is contained in:
1 parent
ecacb1afa7
commit
4dc96ba189
1 file changed
+3
-3
@@ -694,12 +694,12 @@ import ObjectiveC.runtime
|
|||||||
|
|
||||||
private func tweakAlpha(tweakBorderAlpha:Bool, tweakLabelAlpha:Bool = true){
|
private func tweakAlpha(tweakBorderAlpha:Bool, tweakLabelAlpha:Bool = true){
|
||||||
// setup default border from self.backgroundAlpha
|
// setup default border from self.backgroundAlpha
|
||||||
let realBackgroundAlpha = abs(self.backgroundAlpha) - 0.18 // offset to be consistent with legacy onScreen controller layer opacity
|
let realBackgroundAlpha = max(abs(self.backgroundAlpha) - 0.18, 0) // offset to be consistent with legacy onScreen controller layer opacity
|
||||||
self.backgroundColor = UIColor(white:self.backgroundAlpha>0 ? 0.1 : 0.9, alpha: realBackgroundAlpha) // offset to be consistent with legacy onScreen controller layer opacity
|
self.backgroundColor = UIColor(white:self.backgroundAlpha>0 ? 0.1 : 0.9, alpha: realBackgroundAlpha) // offset to be consistent with legacy onScreen controller layer opacity
|
||||||
|
|
||||||
if tweakBorderAlpha {
|
if tweakBorderAlpha {
|
||||||
borderAlpha = realBackgroundAlpha * 1.01
|
borderAlpha = realBackgroundAlpha * 1.005 * (self.backgroundAlpha>0 ? 1 : -1)
|
||||||
defaultBorderColor = UIColor(white: self.backgroundAlpha>0 ? 0.1 : 0.9, alpha: abs(borderAlpha)).cgColor
|
defaultBorderColor = UIColor(white: borderAlpha>0 ? 0.1 : 0.9, alpha: abs(borderAlpha)).cgColor
|
||||||
self.layer.borderColor = defaultBorderColor
|
self.layer.borderColor = defaultBorderColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user