iOS: Improve link contrast in dark mode

This commit is contained in:
Shadowfacts 2020-09-30 18:03:07 -04:00
parent 107c4b0d72
commit 89b226e321
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,8 @@ struct RenderingBlockView: View {
let changeURL: ((URL) -> Void)? let changeURL: ((URL) -> Void)?
@State var hovering = false @State var hovering = false
@Environment(\.colorScheme) var colorScheme: ColorScheme
init(document: Document, block: RenderingBlock, changeURL: ((URL) -> Void)? = nil) { init(document: Document, block: RenderingBlock, changeURL: ((URL) -> Void)? = nil) {
self.document = document self.document = document
self.block = block self.block = block
@ -76,7 +78,9 @@ struct RenderingBlockView: View {
Text(verbatim: text) Text(verbatim: text)
.font(.documentBody) .font(.documentBody)
.foregroundColor(hovering ? .blue : Color.blue.opacity(0.8)) .foregroundColor(colorScheme == .dark ?
hovering ? Color.blue.opacity(0.8) : .blue :
hovering ? .blue : Color.blue.opacity(0.8))
.underline() .underline()
.frame(maxWidth: .infinity, alignment: .leading) .frame(maxWidth: .infinity, alignment: .leading)
} }