mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Fix pattern wallpaper isDark detection
This commit is contained in:
parent
e4bb16bd53
commit
0b2f7bbe61
1 changed files with 7 additions and 1 deletions
|
|
@ -1203,7 +1203,13 @@ public final class WallpaperBackgroundNodeImpl: ASDisplayNode, WallpaperBackgrou
|
|||
self.blurredBackgroundContents = nil
|
||||
self.motionEnabled = false
|
||||
self.wallpaperDisposable.set(nil)
|
||||
self.updateIsDark(calculateWallpaperBrightness(from: gradientColors) <= 0.3)
|
||||
|
||||
if case let .file(file) = wallpaper, file.isPattern {
|
||||
let intensity = CGFloat(file.settings.intensity ?? 50) / 100.0
|
||||
self.updateIsDark(intensity < 0)
|
||||
} else {
|
||||
self.updateIsDark(calculateWallpaperBrightness(from: gradientColors) <= 0.3)
|
||||
}
|
||||
} else {
|
||||
if let gradientBackgroundNode = self.gradientBackgroundNode {
|
||||
self.gradientBackgroundNode = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue