mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-09 04:44:55 +00:00
Fix pattern wallpaper isDark detection
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user