From f47a710fb94d4d596761fdd64ea95fcef4370d4e Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Thu, 23 Nov 2023 18:30:02 +0400 Subject: [PATCH] Fix colors --- .../Sources/AccountContext.swift | 211 +++++++----------- .../AccountData/UpdateAccountPeerName.swift | 11 +- .../Sources/PeerInfoCoverComponent.swift | 60 +---- ...PeerInfoAvatarTransformContainerNode.swift | 13 +- .../Sources/PeerInfoHeaderNode.swift | 14 +- .../Sources/PeerNameColorItem.swift | 2 +- 6 files changed, 113 insertions(+), 198 deletions(-) diff --git a/submodules/AccountContext/Sources/AccountContext.swift b/submodules/AccountContext/Sources/AccountContext.swift index 2ac5c37a66..e8b99a9e40 100644 --- a/submodules/AccountContext/Sources/AccountContext.swift +++ b/submodules/AccountContext/Sources/AccountContext.swift @@ -1264,6 +1264,12 @@ private extension PeerNameColors.Colors { } public class PeerNameColors: Equatable { + public enum Subject { + case background + case palette + case stories + } + public struct Colors: Equatable { public let main: UIColor public let secondary: UIColor? @@ -1318,6 +1324,10 @@ public class PeerNameColors: Equatable { displayOrder: [5, 3, 1, 0, 2, 4, 6], profileColors: [:], profileDarkColors: [:], + profilePaletteColors: [:], + profilePaletteDarkColors: [:], + profileStoryColors: [:], + profileStoryDarkColors: [:], profileDisplayOrder: [] ) } @@ -1328,6 +1338,10 @@ public class PeerNameColors: Equatable { public let profileColors: [Int32: Colors] public let profileDarkColors: [Int32: Colors] + public let profilePaletteColors: [Int32: Colors] + public let profilePaletteDarkColors: [Int32: Colors] + public let profileStoryColors: [Int32: Colors] + public let profileStoryDarkColors: [Int32: Colors] public let profileDisplayOrder: [Int32] public func get(_ color: PeerNameColor, dark: Bool = false) -> Colors { @@ -1340,13 +1354,32 @@ public class PeerNameColors: Equatable { } } - public func getProfile(_ color: PeerNameColor, dark: Bool = false) -> Colors { - if dark, let colors = self.profileDarkColors[color.rawValue] { - return colors - } else if let colors = self.profileColors[color.rawValue] { - return colors - } else { - return Colors(main: UIColor(rgb: 0xcc5049)) + public func getProfile(_ color: PeerNameColor, dark: Bool = false, subject: Subject = .background) -> Colors { + switch subject { + case .background: + if dark, let colors = self.profileDarkColors[color.rawValue] { + return colors + } else if let colors = self.profileColors[color.rawValue] { + return colors + } else { + return Colors(main: UIColor(rgb: 0xcc5049)) + } + case .palette: + if dark, let colors = self.profilePaletteDarkColors[color.rawValue] { + return colors + } else if let colors = self.profilePaletteColors[color.rawValue] { + return colors + } else { + return self.getProfile(color, dark: dark, subject: .background) + } + case .stories: + if dark, let colors = self.profileStoryDarkColors[color.rawValue] { + return colors + } else if let colors = self.profileStoryColors[color.rawValue] { + return colors + } else { + return self.getProfile(color, dark: dark, subject: .background) + } } } @@ -1356,6 +1389,10 @@ public class PeerNameColors: Equatable { displayOrder: [Int32], profileColors: [Int32: Colors], profileDarkColors: [Int32: Colors], + profilePaletteColors: [Int32: Colors], + profilePaletteDarkColors: [Int32: Colors], + profileStoryColors: [Int32: Colors], + profileStoryDarkColors: [Int32: Colors], profileDisplayOrder: [Int32] ) { self.colors = colors @@ -1363,6 +1400,10 @@ public class PeerNameColors: Equatable { self.displayOrder = displayOrder self.profileColors = profileColors self.profileDarkColors = profileDarkColors + self.profilePaletteColors = profilePaletteColors + self.profilePaletteDarkColors = profilePaletteDarkColors + self.profileStoryColors = profileStoryColors + self.profileStoryDarkColors = profileStoryDarkColors self.profileDisplayOrder = profileDisplayOrder } @@ -1372,6 +1413,10 @@ public class PeerNameColors: Equatable { var displayOrder: [Int32] = [] var profileColors: [Int32: Colors] = [:] var profileDarkColors: [Int32: Colors] = [:] + var profilePaletteColors: [Int32: Colors] = [:] + var profilePaletteDarkColors: [Int32: Colors] = [:] + var profileStoryColors: [Int32: Colors] = [:] + var profileStoryDarkColors: [Int32: Colors] = [:] var profileDisplayOrder: [Int32] = [] if !availableReplyColors.options.isEmpty { @@ -1383,17 +1428,11 @@ public class PeerNameColors: Equatable { darkColors[option.key] = parsedDark } - //displayOrder.append(contentsOf: availableReplyColors.options.filter({ !$0.value.isHidden }).map(\.key)) for option in availableReplyColors.options { if !displayOrder.contains(option.key) { displayOrder.append(option.key) } } - /*for i in (0 ..< 7).reversed() { - if !displayOrder.contains(Int32(i)) { - displayOrder.insert(Int32(i), at: 0) - } - }*/ } } else { let defaultValue = PeerNameColors.defaultValue @@ -1410,12 +1449,23 @@ public class PeerNameColors: Equatable { if let parsedDark = (option.value.dark?.background).flatMap(PeerNameColors.Colors.init(colors:)) { profileDarkColors[option.key] = parsedDark } + if let parsedPaletteLight = PeerNameColors.Colors(colors: option.value.light.palette) { + profilePaletteColors[option.key] = parsedPaletteLight + } + if let parsedPaletteDark = (option.value.dark?.palette).flatMap(PeerNameColors.Colors.init(colors:)) { + profilePaletteDarkColors[option.key] = parsedPaletteDark + } + if let parsedStoryLight = (option.value.light.stories).flatMap(PeerNameColors.Colors.init(colors:)) { + profileStoryColors[option.key] = parsedStoryLight + } + if let parsedStoryDark = (option.value.dark?.stories).flatMap(PeerNameColors.Colors.init(colors:)) { + profileStoryDarkColors[option.key] = parsedStoryDark + } for option in availableProfileColors.options { if !profileDisplayOrder.contains(option.key) { profileDisplayOrder.append(option.key) } } - //profileDisplayOrder = availableProfileColors.options.filter({ !$0.value.isHidden }).map(\.key) } } @@ -1425,125 +1475,12 @@ public class PeerNameColors: Equatable { displayOrder: displayOrder, profileColors: profileColors, profileDarkColors: profileDarkColors, + profilePaletteColors: profilePaletteColors, + profilePaletteDarkColors: profilePaletteDarkColors, + profileStoryColors: profileStoryColors, + profileStoryDarkColors: profileStoryDarkColors, profileDisplayOrder: profileDisplayOrder ) - - /*if let data = appConfiguration.data { - var colors = PeerNameColors.defaultSingleColors - var darkColors: [Int32: Colors] = [:] - - if let peerColors = data["peer_colors"] as? [String: [String]] { - for (key, values) in peerColors { - if let index = Int32(key) { - let colorsArray = values.compactMap { UIColor(hexString: $0) } - if let colorValues = Colors(colors: colorsArray) { - colors[index] = colorValues - } - } - } - } - - if let darkPeerColors = data["dark_peer_colors"] as? [String: [String]] { - for (key, values) in darkPeerColors { - if let index = Int32(key) { - let colorsArray = values.compactMap { UIColor(hexString: $0) } - if let colorValues = Colors(colors: colorsArray) { - darkColors[index] = colorValues - } - } - } - } - - var displayOrder: [Int32] = [] - if let order = data["peer_colors_available"] as? [Double] { - displayOrder = order.map { Int32($0) } - } - if displayOrder.isEmpty { - displayOrder = PeerNameColors.defaultValue.displayOrder - } - - var profileColors = PeerNameColors.defaultSingleColors - var profileDarkColors: [Int32: Colors] = [:] - - if let peerColors = data["profile_colors"] as? [String: [String]] { - for (key, values) in peerColors { - if let index = Int32(key) { - let colorsArray = values.compactMap { UIColor(hexString: $0) } - if let colorValues = Colors(colors: colorsArray) { - profileColors[index] = colorValues - } - } - } - } else { - profileColors = [ - 0: Colors(main: UIColor(rgb: 0x5A8FBB), secondary: nil, tertiary: nil), - 1: Colors(main: UIColor(rgb: 0x49A355), secondary: nil, tertiary: nil), - 2: Colors(main: UIColor(rgb: 0xC27C3E), secondary: nil, tertiary: nil), - 3: Colors(main: UIColor(rgb: 0xBA5650), secondary: nil, tertiary: nil), - 4: Colors(main: UIColor(rgb: 0x956AC8), secondary: nil, tertiary: nil), - 5: Colors(main: UIColor(rgb: 0x3E97AD), secondary: nil, tertiary: nil), - 6: Colors(main: UIColor(rgb: 0xB85378), secondary: nil, tertiary: nil), - 7: Colors(main: UIColor(rgb: 0x7F8B95), secondary: nil, tertiary: nil), - 8: Colors(main: UIColor(rgb: 0x538BC2), secondary: UIColor(rgb: 0x4DA8BD), tertiary: nil), - 9: Colors(main: UIColor(rgb: 0x3D9755), secondary: UIColor(rgb: 0x89A650), tertiary: nil), - 10: Colors(main: UIColor(rgb: 0xCF7244), secondary: UIColor(rgb: 0xCC9433), tertiary: nil), - 11: Colors(main: UIColor(rgb: 0xC9565D), secondary: UIColor(rgb: 0xD97C57), tertiary: nil), - 12: Colors(main: UIColor(rgb: 0x9662D4), secondary: UIColor(rgb: 0xB966B6), tertiary: nil), - 13: Colors(main: UIColor(rgb: 0x3D95BA), secondary: UIColor(rgb: 0x50AD98), tertiary: nil), - 14: Colors(main: UIColor(rgb: 0xB04F74), secondary: UIColor(rgb: 0xD1666D), tertiary: nil), - 15: Colors(main: UIColor(rgb: 0x637482), secondary: UIColor(rgb: 0x7B8A97), tertiary: nil), - ] - } - - if let darkPeerColors = data["dark_profile_colors"] as? [String: [String]] { - for (key, values) in darkPeerColors { - if let index = Int32(key) { - let colorsArray = values.compactMap { UIColor(hexString: $0) } - if let colorValues = Colors(colors: colorsArray) { - profileDarkColors[index] = colorValues - } - } - } - } else { - profileDarkColors = [ - 0: Colors(main: UIColor(rgb: 0x477194), secondary: nil, tertiary: nil), - 1: Colors(main: UIColor(rgb: 0x33713B), secondary: nil, tertiary: nil), - 2: Colors(main: UIColor(rgb: 0x945E2C), secondary: nil, tertiary: nil), - 3: Colors(main: UIColor(rgb: 0x9C4540), secondary: nil, tertiary: nil), - 4: Colors(main: UIColor(rgb: 0x715099), secondary: nil, tertiary: nil), - 5: Colors(main: UIColor(rgb: 0x387E87), secondary: nil, tertiary: nil), - 6: Colors(main: UIColor(rgb: 0x944763), secondary: nil, tertiary: nil), - 7: Colors(main: UIColor(rgb: 0x435261), secondary: nil, tertiary: nil), - 8: Colors(main: UIColor(rgb: 0x38618C), secondary: UIColor(rgb: 0x458BA1), tertiary: nil), - 9: Colors(main: UIColor(rgb: 0x296A43), secondary: UIColor(rgb: 0x5F8F44), tertiary: nil), - 10: Colors(main: UIColor(rgb: 0x8F552F), secondary: UIColor(rgb: 0xA17232), tertiary: nil), - 11: Colors(main: UIColor(rgb: 0x994343), secondary: UIColor(rgb: 0xAC583E), tertiary: nil), - 12: Colors(main: UIColor(rgb: 0x634691), secondary: UIColor(rgb: 0x9250A2), tertiary: nil), - 13: Colors(main: UIColor(rgb: 0x306C7C), secondary: UIColor(rgb: 0x3E987E), tertiary: nil), - 14: Colors(main: UIColor(rgb: 0x884160), secondary: UIColor(rgb: 0xA65259), tertiary: nil), - 15: Colors(main: UIColor(rgb: 0x384654), secondary: UIColor(rgb: 0x99ACC3), tertiary: nil), - ] - } - - var profileDisplayOrder: [Int32] = [] - if let order = data["profile_colors_available"] as? [Double] { - profileDisplayOrder = order.map { Int32($0) } - } - if profileDisplayOrder.isEmpty { - profileDisplayOrder = Array((0 ..< profileColors.count).map { i in Int32(i) }) - } - - return PeerNameColors( - colors: colors, - darkColors: darkColors, - displayOrder: displayOrder, - profileColors: profileColors, - profileDarkColors: profileDarkColors, - profileDisplayOrder: profileDisplayOrder - ) - } else { - return .defaultValue - }*/ } public static func == (lhs: PeerNameColors, rhs: PeerNameColors) -> Bool { @@ -1562,6 +1499,18 @@ public class PeerNameColors: Equatable { if lhs.profileDarkColors != rhs.profileDarkColors { return false } + if lhs.profilePaletteColors != rhs.profilePaletteColors { + return false + } + if lhs.profilePaletteDarkColors != rhs.profilePaletteDarkColors { + return false + } + if lhs.profileStoryColors != rhs.profileStoryColors { + return false + } + if lhs.profileStoryDarkColors != rhs.profileStoryDarkColors { + return false + } if lhs.profileDisplayOrder != rhs.profileDisplayOrder { return false } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/AccountData/UpdateAccountPeerName.swift b/submodules/TelegramCore/Sources/TelegramEngine/AccountData/UpdateAccountPeerName.swift index 7dd5ac8f24..a89ff30563 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/AccountData/UpdateAccountPeerName.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/AccountData/UpdateAccountPeerName.swift @@ -64,11 +64,16 @@ func _internal_updateNameColorAndEmoji(account: Account, nameColor: PeerNameColo |> switchToLatest |> castError(UpdateNameColorAndEmojiError.self) |> mapToSignal { _ -> Signal in - let flagsReplies: Int32 = 1 << 0 - let flagsProfile: Int32 = (1 << 0) | (1 << 1) + let flagsReplies: Int32 = (1 << 0) | (1 << 2) + + var flagsProfile: Int32 = (1 << 0) | (1 << 1) + if profileColor != nil { + flagsProfile |= (1 << 2) + } + return combineLatest( account.network.request(Api.functions.account.updateColor(flags: flagsReplies, color: nameColor.rawValue, backgroundEmojiId: backgroundEmojiId ?? 0)), - account.network.request(Api.functions.account.updateColor(flags: flagsProfile, color: profileColor?.rawValue ?? 0, backgroundEmojiId: profileBackgroundEmojiId ?? 0)) + account.network.request(Api.functions.account.updateColor(flags: flagsProfile, color: profileColor?.rawValue, backgroundEmojiId: profileBackgroundEmojiId ?? 0)) ) |> mapError { _ -> UpdateNameColorAndEmojiError in return .generic diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoCoverComponent/Sources/PeerInfoCoverComponent.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoCoverComponent/Sources/PeerInfoCoverComponent.swift index f6c5b91258..cf5850afd0 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoCoverComponent/Sources/PeerInfoCoverComponent.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoCoverComponent/Sources/PeerInfoCoverComponent.swift @@ -236,17 +236,13 @@ public final class PeerInfoCoverComponent: Component { let backgroundColor: UIColor var secondaryBackgroundColor: UIColor - let patternColor: UIColor if let peer = component.peer, let colors = peer._asPeer().profileColor.flatMap({ component.context.peerNameColors.getProfile($0, dark: component.isDark) }) { backgroundColor = colors.main secondaryBackgroundColor = colors.secondary ?? colors.main - - patternColor = UIColor(white: 0.0, alpha: component.isDark ? 0.2 : 0.15).blendOver(background: backgroundColor) } else { backgroundColor = .clear secondaryBackgroundColor = .clear - patternColor = .clear } self.backgroundView.backgroundColor = secondaryBackgroundColor @@ -258,7 +254,8 @@ public final class PeerInfoCoverComponent: Component { //self.backgroundGradientLayer.colors = [UIColor.green.cgColor, UIColor.blue.cgColor] self.backgroundGradientLayer.anchorPoint = CGPoint(x: 0.0, y: 1.0) - let backgroundGradientFrame = CGRect(origin: CGPoint(x: 0.0, y: availableSize.height - 350.0), size: CGSize(width: availableSize.width, height: 350.0)) + let gradientHeight: CGFloat = 350.0 + let backgroundGradientFrame = CGRect(origin: CGPoint(x: 0.0, y: availableSize.height - 350.0), size: CGSize(width: availableSize.width, height: gradientHeight)) if !transition.animation.isImmediate { let previousPosition = self.backgroundGradientLayer.position let updatedPosition = CGPoint(x: backgroundGradientFrame.minX, y: backgroundGradientFrame.maxY) @@ -332,6 +329,10 @@ public final class PeerInfoCoverComponent: Component { self.avatarPatternContentLayers.append(itemLayer) } + let gradientPosition: CGFloat = max(0.0, min(1.0, (avatarBackgroundPatternContainerFrame.midY + itemFrame.midY) / gradientHeight)) + let itemBackgroundColor: UIColor = secondaryBackgroundColor.mixedWith(backgroundColor, alpha: gradientPosition) + let patternColor = UIColor(white: 0.0, alpha: component.isDark ? 0.2 : 0.2).blendOver(background: itemBackgroundColor) + itemLayer.frame = itemFrame itemLayer.layerTintColor = patternColor.cgColor transition.setAlpha(layer: itemLayer, alpha: (1.0 - CGFloat(row) / 5.0) * (1.0 - itemScaleFraction)) @@ -346,55 +347,6 @@ public final class PeerInfoCoverComponent: Component { self.avatarPatternContentLayers.removeSubrange(avatarBackgroundPatternLayerCount ..< self.avatarPatternContentLayers.count) } - /*let patternSpanX: CGFloat = 82.0 - let patternSpanY: CGFloat = 71.0 - let patternHeight: CGFloat = 86.0 - - var backgroundPatternCount = 0 - var patternY: CGFloat = -patternHeight - var patternRowIndex = 0 - while true { - if patternY >= 50.0 { - break - } - - var offsetFromCenter: CGFloat = patternRowIndex % 2 == 0 ? 0.0 : patternSpanX * 0.5 - while true { - if offsetFromCenter >= availableSize.width * 0.5 + 50.0 { - break - } - - for i in 0 ..< (offsetFromCenter == 0.0 ? 1 : 2) { - let itemPosition = CGPoint(x: availableSize.width * 0.5 + (i == 0 ? -1.0 : 1.0) * offsetFromCenter, y: patternY) - let itemLayer: SimpleLayer - if self.backgroundPatternContentLayers.count > backgroundPatternCount { - itemLayer = self.backgroundPatternContentLayers[backgroundPatternCount] - } else { - itemLayer = SimpleLayer() - itemLayer.contents = self.patternContentsTarget?.contents - self.backgroundPatternContainer.layer.addSublayer(itemLayer) - self.backgroundPatternContentLayers.append(itemLayer) - } - - let itemFrame = CGSize(width: 24.0, height: 24.0).centered(around: itemPosition) - itemLayer.frame = itemFrame - itemLayer.layerTintColor = patternColor.cgColor - - backgroundPatternCount += 1 - } - - offsetFromCenter += patternSpanX - } - patternY += patternSpanY - patternRowIndex += 1 - } - if backgroundPatternCount > self.backgroundPatternContentLayers.count { - for i in backgroundPatternCount ..< self.backgroundPatternContentLayers.count { - self.backgroundPatternContentLayers[i].removeFromSuperlayer() - } - self.backgroundPatternContentLayers.removeSubrange(backgroundPatternCount ..< self.backgroundPatternContentLayers.count) - }*/ - return availableSize } } diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift index 41fab89171..242b545995 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoAvatarTransformContainerNode.swift @@ -89,8 +89,17 @@ final class PeerInfoAvatarTransformContainerNode: ASDisplayNode { let regularNavigationContentsSecondaryColor: UIColor if let profileColor = peer?.profileColor { - let backgroundColor = self.context.peerNameColors.getProfile(profileColor).main - regularNavigationContentsSecondaryColor = UIColor(white: 1.0, alpha: 0.6).blitOver(backgroundColor.withMultiplied(hue: 1.0, saturation: 2.2, brightness: 1.5), alpha: 1.0) + let backgroundColors = self.context.peerNameColors.getProfile(profileColor, dark: theme.overallDarkAppearance) + regularNavigationContentsSecondaryColor = UIColor(white: 1.0, alpha: 0.6).blitOver(backgroundColors.main.withMultiplied(hue: 1.0, saturation: 2.2, brightness: 1.5), alpha: 1.0) + + let storyColors = self.context.peerNameColors.getProfile(profileColor, dark: theme.overallDarkAppearance, subject: .stories) + + var unseenColors: [UIColor] = [storyColors.main] + if let secondary = storyColors.secondary { + unseenColors.insert(secondary, at: 0) + } + colors.unseenColors = unseenColors + colors.unseenCloseFriendsColors = colors.unseenColors } else { regularNavigationContentsSecondaryColor = theme.list.controlSecondaryColor } diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift index dbc860abbc..e2b573df1d 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoHeaderNode.swift @@ -526,17 +526,17 @@ final class PeerInfoHeaderNode: ASDisplayNode { let regularNavigationContentsSecondaryColor: UIColor if let profileColor = peer?.profileColor { - let backgroundColor = self.context.peerNameColors.getProfile(profileColor, dark: presentationData.theme.overallDarkAppearance).main - regularNavigationContentsSecondaryColor = UIColor(white: 1.0, alpha: 0.6).blitOver(backgroundColor.withMultiplied(hue: 1.0, saturation: 2.2, brightness: 1.5), alpha: 1.0) + let backgroundColors = self.context.peerNameColors.getProfile(profileColor, dark: presentationData.theme.overallDarkAppearance) + regularNavigationContentsSecondaryColor = UIColor(white: 1.0, alpha: 0.6).blitOver(backgroundColors.main.withMultiplied(hue: 1.0, saturation: 2.2, brightness: 1.5), alpha: 1.0) + let baseButtonBackgroundColor: UIColor if presentationData.theme.overallDarkAppearance { - let baseButtonBackgroundColor: UIColor = UIColor(white: 0.0, alpha: 0.25) - regularContentButtonBackgroundColor = baseButtonBackgroundColor.blendOver(background: backgroundColor) + baseButtonBackgroundColor = UIColor(white: 0.0, alpha: 0.25) } else { - let baseButtonBackgroundColor: UIColor = UIColor(white: 1.0, alpha: 0.25) - regularContentButtonBackgroundColor = baseButtonBackgroundColor.blendOver(background: backgroundColor) + baseButtonBackgroundColor = UIColor(white: 1.0, alpha: 0.25) } - regularHeaderButtonBackgroundColor = regularContentButtonBackgroundColor + regularContentButtonBackgroundColor = baseButtonBackgroundColor.blendOver(background: backgroundColors.main) + regularHeaderButtonBackgroundColor = baseButtonBackgroundColor.blendOver(background: backgroundColors.secondary ?? backgroundColors.main) } else { regularNavigationContentsSecondaryColor = presentationData.theme.list.itemSecondaryTextColor regularContentButtonBackgroundColor = presentationData.theme.list.itemBlocksBackgroundColor diff --git a/submodules/TelegramUI/Components/Settings/PeerNameColorScreen/Sources/PeerNameColorItem.swift b/submodules/TelegramUI/Components/Settings/PeerNameColorScreen/Sources/PeerNameColorItem.swift index 7e7863506a..7fb25f90e5 100644 --- a/submodules/TelegramUI/Components/Settings/PeerNameColorScreen/Sources/PeerNameColorItem.swift +++ b/submodules/TelegramUI/Components/Settings/PeerNameColorScreen/Sources/PeerNameColorItem.swift @@ -555,7 +555,7 @@ final class PeerNameColorItemNode: ListViewItemNode, ItemListItemNode { let color = PeerNameColor(rawValue: index) let colors: PeerNameColors.Colors if item.isProfile { - colors = item.colors.getProfile(color, dark: item.theme.overallDarkAppearance) + colors = item.colors.getProfile(color, dark: item.theme.overallDarkAppearance, subject: .palette) } else { colors = item.colors.get(color, dark: item.theme.overallDarkAppearance) }