Implement Math view

This commit is contained in:
Guille Gonzalez
2026-01-04 15:33:48 +01:00
parent 6e1a38ede7
commit baea9de415
9 changed files with 356 additions and 8 deletions

View 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
}