Use the UIColors directly instead of wrapping the SwiftUI Colors. (#3324)

This commit is contained in:
Doug
2024-09-24 12:24:03 +01:00
committed by GitHub
parent d73681221d
commit c264e9e590
8 changed files with 21 additions and 11 deletions
@@ -5,6 +5,7 @@
// Please see LICENSE in the repository root for full details.
//
import Compound
import DTCoreText
import Foundation
import LRUCache
@@ -267,7 +268,7 @@ struct AttributedStringBuilder: AttributedStringBuilderProtocol {
attributedString.enumerateAttribute(.backgroundColor, in: .init(location: 0, length: attributedString.length), options: []) { value, range, _ in
if let value = value as? UIColor,
value == temporaryCodeBlockMarkingColor {
attributedString.addAttribute(.backgroundColor, value: UIColor(.compound._bgCodeBlock) as Any, range: range)
attributedString.addAttribute(.backgroundColor, value: UIColor.compound._bgCodeBlock as Any, range: range)
attributedString.removeAttribute(.link, range: range)
}
}