Infer opaque background color for legacy themes

This commit is contained in:
Ali 2021-06-13 15:22:35 +04:00
parent 8c5f8744e5
commit 3851ac14ba

View File

@ -426,6 +426,7 @@ extension PresentationThemeRootNavigationBar: Codable {
public convenience init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
let blurredBackgroundColor = try decodeColor(values, .background)
self.init(
buttonColor: try decodeColor(values, .button),
@ -434,8 +435,8 @@ extension PresentationThemeRootNavigationBar: Codable {
secondaryTextColor: try decodeColor(values, .secondaryText),
controlColor: try decodeColor(values, .control),
accentTextColor: try decodeColor(values, .accentText),
blurredBackgroundColor: try decodeColor(values, .background),
opaqueBackgroundColor: try decodeColor(values, .opaqueBackground, fallbackKey: "root.navBar.background"),
blurredBackgroundColor: blurredBackgroundColor,
opaqueBackgroundColor: (try? decodeColor(values, .opaqueBackground)) ?? blurredBackgroundColor.withAlphaComponent(1.0),
separatorColor: try decodeColor(values, .separator),
badgeBackgroundColor: try decodeColor(values, .badgeFill),
badgeStrokeColor: try decodeColor(values, .badgeStroke),