Просмотр исходного кода

improve readability in dark mode

cyberta 3 лет назад
Родитель
Сommit
8165964bd2
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      DcCore/DcCore/Helper/DcColors.swift
  2. 1 1
      deltachat-ios/Helper/MessageUtils.swift

+ 1 - 0
DcCore/DcCore/Helper/DcColors.swift

@@ -6,6 +6,7 @@ public struct DcColors {
 
 
     public static let primary = UIColor.systemBlue
+    public static let highlight = UIColor.themeColor(light: UIColor.yellow, dark: UIColor.systemBlue)
     public static let colorDisabled = UIColor.themeColor(light: UIColor(white: 0.9, alpha: 1), dark: UIColor(white: 0.2, alpha: 1))
     public static let messagePrimaryColor = UIColor.themeColor(light: UIColor.rgb(red: 220, green: 248, blue: 198),
                                                         dark: UIColor.init(hexString: "224508"))

+ 1 - 1
deltachat-ios/Helper/MessageUtils.swift

@@ -146,7 +146,7 @@ public class MessageUtils {
                 let range = (messageText.lowercased() as NSString).range(of: searchText.lowercased())
                 mutableAttributedString.addAttribute(.font, value: UIFont.preferredFont(for: .body, weight: .semibold), range: range)
                 if highlight {
-                    mutableAttributedString.addAttribute(.backgroundColor, value: UIColor.systemYellow, range: range)
+                    mutableAttributedString.addAttribute(.backgroundColor, value: DcColors.highlight, range: range)
                 }
             }
             return mutableAttributedString