ThemedShape

@MainActor
public struct ThemedShape<S> : View where S : Shape

A SwiftUI view that renders a shape using a color defined in the current theme.

ThemedShape allows developers to apply consistent, theme-based coloring to any SwiftUI Shape, leveraging the ColorToken system from Theme.colors.

The actual color is resolved from the current Theme injected in the environment via ThemeProvider.

Example usage:

ThemedShape(shape: Circle(), color: .accent)
    .frame(width: 50, height: 50)

Note

Ensure the view hierarchy is wrapped in a ThemeProvider so the theme environment is properly available.
  • The SwiftUI shape to render, such as Circle, RoundedRectangle, etc.

    Declaration

    Swift

    @MainActor
    public let shape: S
  • The color token to apply to the shape’s fill, resolved from the theme.

    Declaration

    Swift

    @MainActor
    public let color: ColorToken
  • The content and behavior of the ThemedShape view.

    Declaration

    Swift

    @MainActor
    public var body: some View { get }