Conform the logic to decide wallpaper darkness

Make sure that the logic of deciding if the wallpaper is dark or light
is the same as defined in Tonal.

Test: Manaully tested the color is the same as the lock screen
Bug: 286425611
Change-Id: I4b66edb86008ad817028eb444d4b121ae054631e
This commit is contained in:
George Lin
2023-06-08 19:02:58 +00:00
parent 6994621472
commit 6f99676c45

View File

@@ -404,8 +404,7 @@ constructor(
val darkClockColor = wallpaperColorScheme?.accent2?.s600
/** Note that when [wallpaperColors] is null, isWallpaperDark is true. */
val isWallpaperDark: Boolean =
(wallpaperColors?.colorHints?.and(WallpaperColors.HINT_SUPPORTS_DARK_TEXT)) !=
WallpaperColors.HINT_SUPPORTS_DARK_TEXT
(wallpaperColors?.colorHints?.and(WallpaperColors.HINT_SUPPORTS_DARK_TEXT)) == 0
clock.events.onSeedColorChanged(
if (isWallpaperDark) lightClockColor else darkClockColor
)