Add documentation

This commit is contained in:
Guille Gonzalez
2026-01-11 06:53:55 +01:00
parent 339f20a34b
commit 8d32feb1bd
4 changed files with 63 additions and 0 deletions

View File

@@ -1,10 +1,14 @@
import SwiftUI
extension Math {
/// Controls how colors are applied when rendering math.
public enum RenderingMode: Sendable {
/// Draws all glyphs using the view's foreground style.
case monochrome
/// Honors LaTeX color commands and uses the base color for uncolored glyphs.
case multicolor(base: SwiftUI.Color)
/// Multicolor rendering using the view's primary color as the base.
static var multicolor: Self {
.multicolor(base: .primary)
}
@@ -12,6 +16,7 @@ extension Math {
}
extension View {
/// Sets the rendering mode for ``Math`` views in this hierarchy.
public func mathRenderingMode(_ mathRenderingMode: Math.RenderingMode) -> some View {
environment(\.mathRenderingMode, mathRenderingMode)
}