Implement Math view
This commit is contained in:
22
Sources/SwiftUIMath/RenderingMode.swift
Normal file
22
Sources/SwiftUIMath/RenderingMode.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
import SwiftUI
|
||||
|
||||
extension Math {
|
||||
public enum RenderingMode: Sendable {
|
||||
case monochrome
|
||||
case multicolor(base: SwiftUI.Color)
|
||||
|
||||
static var multicolor: Self {
|
||||
.multicolor(base: .primary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
public func mathRenderingMode(_ mathRenderingMode: Math.RenderingMode) -> some View {
|
||||
environment(\.mathRenderingMode, mathRenderingMode)
|
||||
}
|
||||
}
|
||||
|
||||
extension EnvironmentValues {
|
||||
@Entry var mathRenderingMode: Math.RenderingMode = .monochrome
|
||||
}
|
||||
Reference in New Issue
Block a user