Adjust colors

This commit is contained in:
Ali 2022-08-30 20:35:42 +04:00
parent 288368cfff
commit 1fdf09cbda
7 changed files with 29 additions and 5 deletions

View File

@ -2284,7 +2284,8 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
let leftInset: CGFloat = params.leftInset + avatarLeftInset
let rawContentRect = CGRect(origin: CGPoint(x: 2.0, y: layoutOffset + 8.0), size: CGSize(width: params.width - leftInset - params.rightInset - 10.0 - editingOffset, height: self.bounds.size.height - 12.0 - 9.0))
let rawContentWidth = params.width - leftInset - params.rightInset - 10.0 - editingOffset
let rawContentRect = CGRect(origin: CGPoint(x: 2.0, y: layoutOffset + 8.0), size: CGSize(width: rawContentWidth, height: 0.0))
let contentRect = rawContentRect.offsetBy(dx: editingOffset + leftInset + offset, dy: 0.0)

View File

@ -611,6 +611,7 @@ public func makeDefaultDarkPresentationTheme(extendingThemeReference: Presentati
panelHighlightedIconColor: UIColor(rgb: 0x808080).mixedWith(UIColor(rgb: 0xffffff), alpha: 0.35),
panelContentVibrantOverlayColor: UIColor(rgb: 0x808080),
panelContentControlVibrantOverlayColor: UIColor(rgb: 0x808080).mixedWith(UIColor(rgb: 0x000000), alpha: 0.35),
panelContentControlVibrantSelectionColor: UIColor(white: 1.0, alpha: 0.1),
stickersBackgroundColor: UIColor(rgb: 0x000000),
stickersSectionTextColor: UIColor(rgb: 0x7b7b7b),
stickersSearchBackgroundColor: UIColor(rgb: 0x1c1c1d),

View File

@ -844,6 +844,7 @@ public func makeDefaultDarkTintedPresentationTheme(extendingThemeReference: Pres
panelHighlightedIconColor: mainSecondaryTextColor.withAlphaComponent(0.5).mixedWith(inputPanel.primaryTextColor, alpha: 0.35),
panelContentVibrantOverlayColor: mainSecondaryTextColor.withAlphaComponent(0.5),
panelContentControlVibrantOverlayColor: mainSecondaryTextColor.withAlphaComponent(0.3),
panelContentControlVibrantSelectionColor: mainSecondaryTextColor.withAlphaComponent(0.1),
stickersBackgroundColor: additionalBackgroundColor,
stickersSectionTextColor: mainSecondaryTextColor.withAlphaComponent(0.5),
stickersSearchBackgroundColor: accentColor.withMultiplied(hue: 1.009, saturation: 0.621, brightness: 0.15),

View File

@ -865,6 +865,7 @@ public func makeDefaultDayPresentationTheme(extendingThemeReference: Presentatio
panelHighlightedIconColor: UIColor(rgb: 0x4D5561),
panelContentVibrantOverlayColor: UIColor(white: 0.7, alpha: 0.65),
panelContentControlVibrantOverlayColor: UIColor(white: 0.85, alpha: 0.65),
panelContentControlVibrantSelectionColor: UIColor(white: 0.85, alpha: 0.1),
stickersBackgroundColor: UIColor(rgb: 0xe8ebf0),
stickersSectionTextColor: UIColor(rgb: 0x9099a2),
stickersSearchBackgroundColor: UIColor(rgb: 0xd9dbe1),

View File

@ -1145,6 +1145,7 @@ public final class PresentationThemeInputMediaPanel {
public let panelHighlightedIconColor: UIColor
public let panelContentVibrantOverlayColor: UIColor
public let panelContentControlVibrantOverlayColor: UIColor
public let panelContentControlVibrantSelectionColor: UIColor
public let stickersBackgroundColor: UIColor
public let stickersSectionTextColor: UIColor
public let stickersSearchBackgroundColor: UIColor
@ -1161,6 +1162,7 @@ public final class PresentationThemeInputMediaPanel {
panelHighlightedIconColor: UIColor,
panelContentVibrantOverlayColor: UIColor,
panelContentControlVibrantOverlayColor: UIColor,
panelContentControlVibrantSelectionColor: UIColor,
stickersBackgroundColor: UIColor,
stickersSectionTextColor: UIColor,
stickersSearchBackgroundColor: UIColor,
@ -1176,6 +1178,7 @@ public final class PresentationThemeInputMediaPanel {
self.panelHighlightedIconColor = panelHighlightedIconColor
self.panelContentVibrantOverlayColor = panelContentVibrantOverlayColor
self.panelContentControlVibrantOverlayColor = panelContentControlVibrantOverlayColor
self.panelContentControlVibrantSelectionColor = panelContentControlVibrantSelectionColor
self.stickersBackgroundColor = stickersBackgroundColor
self.stickersSectionTextColor = stickersSectionTextColor
self.stickersSearchBackgroundColor = stickersSearchBackgroundColor
@ -1193,6 +1196,7 @@ public final class PresentationThemeInputMediaPanel {
panelHighlightedIconColor: UIColor? = nil,
panelContentVibrantOverlayColor: UIColor? = nil,
panelContentControlVibrantOverlayColor: UIColor? = nil,
panelContentControlVibrantSelectionColor: UIColor? = nil,
stickersBackgroundColor: UIColor? = nil,
stickersSectionTextColor: UIColor? = nil,
stickersSearchBackgroundColor: UIColor? = nil,
@ -1209,6 +1213,7 @@ public final class PresentationThemeInputMediaPanel {
panelHighlightedIconColor: panelHighlightedIconColor ?? self.panelHighlightedIconColor,
panelContentVibrantOverlayColor: panelContentVibrantOverlayColor ?? self.panelContentVibrantOverlayColor,
panelContentControlVibrantOverlayColor: panelContentControlVibrantOverlayColor ?? self.panelContentControlVibrantOverlayColor,
panelContentControlVibrantSelectionColor: panelContentControlVibrantSelectionColor ?? self.panelContentControlVibrantSelectionColor,
stickersBackgroundColor: stickersBackgroundColor ?? self.stickersBackgroundColor,
stickersSectionTextColor: stickersSectionTextColor ?? self.stickersSectionTextColor,
stickersSearchBackgroundColor: stickersSearchBackgroundColor ?? self.stickersSearchBackgroundColor,

View File

@ -1608,6 +1608,7 @@ extension PresentationThemeInputMediaPanel: Codable {
case panelHighlightedIcon
case panelContentVibrantOverlay
case panelContentControlVibrantOverlay
case panelContentControlVibrantSelection
case stickersBg
case stickersSectionText
case stickersSearchBg
@ -1646,6 +1647,7 @@ extension PresentationThemeInputMediaPanel: Codable {
panelHighlightedIconColor: panelHighlightedIconColor,
panelContentVibrantOverlayColor: try decodeColor(values, .panelContentVibrantOverlay, fallbackKey: "\(codingPath).stickersSectionText"),
panelContentControlVibrantOverlayColor: try decodeColor(values, .panelContentControlVibrantOverlay, fallbackKey: "\(codingPath).stickersSectionText"),
panelContentControlVibrantSelectionColor: try decodeColor(values, .panelContentControlVibrantSelection, fallbackKey: "\(codingPath).stickersSectionText"),
stickersBackgroundColor: try decodeColor(values, .stickersBg),
stickersSectionTextColor: try decodeColor(values, .stickersSectionText),
stickersSearchBackgroundColor: try decodeColor(values, .stickersSearchBg),
@ -1663,6 +1665,7 @@ extension PresentationThemeInputMediaPanel: Codable {
try encodeColor(&values, self.panelHighlightedIconColor, .panelHighlightedIcon)
try encodeColor(&values, self.panelContentVibrantOverlayColor, .panelContentVibrantOverlay)
try encodeColor(&values, self.panelContentControlVibrantOverlayColor, .panelContentControlVibrantOverlay)
try encodeColor(&values, self.panelContentControlVibrantSelectionColor, .panelContentControlVibrantSelection)
try encodeColor(&values, self.stickersBackgroundColor, .stickersBg)
try encodeColor(&values, self.stickersSectionTextColor, .stickersSectionText)
try encodeColor(&values, self.stickersSearchBackgroundColor, .stickersSearchBg)

View File

@ -2749,7 +2749,11 @@ public final class EmojiPagerContentComponent: Component {
let distanceNorm = min(1.0, max(0.0, distance / self.bounds.width))
let delay = 0.05 + (distanceNorm) * 0.3
itemLayer.animateScale(from: 0.01, to: 1.0, duration: 0.18, delay: delay, timingFunction: kCAMediaTimingFunctionSpring)
let t = itemLayer.transform
let currentScale = sqrt((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))
itemLayer.animateScale(from: 0.01, to: currentScale, duration: 0.18, delay: delay, timingFunction: kCAMediaTimingFunctionSpring)
if let itemSelectionLayer = self.visibleItemSelectionLayers[key] {
itemSelectionLayer.animateScale(from: 0.01, to: 1.0, duration: 0.18, delay: delay, timingFunction: kCAMediaTimingFunctionSpring)
@ -2786,7 +2790,11 @@ public final class EmojiPagerContentComponent: Component {
let delay = listViewAnimationCurveSystem(distanceNorm) * 0.1
itemLayer.animateAlpha(from: 0.0, to: 1.0, duration: 0.15, delay: delay)
itemLayer.animateSpring(from: 0.01 as NSNumber, to: 1.0 as NSNumber, keyPath: "transform.scale", duration: 0.6, delay: delay)
let t = itemLayer.transform
let currentScale = sqrt((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))
itemLayer.animateSpring(from: 0.01 as NSNumber, to: currentScale as NSNumber, keyPath: "transform.scale", duration: 0.6, delay: delay)
if let itemSelectionLayer = self.visibleItemSelectionLayers[key] {
itemSelectionLayer.animateAlpha(from: 0.0, to: 1.0, duration: 0.15, delay: delay)
@ -4031,9 +4039,13 @@ public final class EmojiPagerContentComponent: Component {
self.visibleItemSelectionLayers[itemId] = itemSelectionLayer
}
itemSelectionLayer.backgroundColor = keyboardChildEnvironment.theme.chat.inputMediaPanel.panelContentControlVibrantOverlayColor.cgColor
itemSelectionLayer.tintContainerLayer.backgroundColor = UIColor.white.cgColor
itemSelectionLayer.backgroundColor = keyboardChildEnvironment.theme.chat.inputMediaPanel.panelContentControlVibrantSelectionColor.cgColor
itemSelectionLayer.tintContainerLayer.backgroundColor = UIColor(white: 1.0, alpha: 0.2).cgColor
itemSelectionLayer.frame = baseItemFrame
itemLayer.transform = CATransform3DMakeScale(0.8, 0.8, 1.0)
} else {
itemLayer.transform = CATransform3DIdentity
}
if animateItemIn, !transition.animation.isImmediate, let contentAnimation = contentAnimation, case .groupExpanded(id: itemGroup.groupId) = contentAnimation.type, let placeholderView = self.visibleItemPlaceholderViews[itemId] {