Overloads
3 ways to call compose().foregroundStyle(). Each is one SwiftUI overload, picked by the arguments you pass.
compose().foregroundStyle(
primary: SwiftUI.ShapeStyle,
secondary: SwiftUI.ShapeStyle,
tertiary: SwiftUI.ShapeStyle
)nonisolated func foregroundStyle<S1, S2, S3>(
_ primary: S1,
_ secondary: S2,
_ tertiary: S3
) -> some View
where S1 : ShapeStyle, S2 : ShapeStyle, S3 : ShapeStyleParameters
primary*SwiftUI.ShapeStyleThe primary color or pattern to use when filling in the foreground elements. To indicate a specific value, use
ColororShapeStyle.image(_:sourceRect:scale:), or one of the gradient types, likeShapeStyle.linearGradient(colors:startPoint:endPoint:). To set a style that’s relative to the containing view's style, use one of the semantic styles, likeShapeStyle.primary.secondary*SwiftUI.ShapeStyleThe secondary color or pattern to use when filling in the foreground elements.
tertiary*SwiftUI.ShapeStyleThe tertiary color or pattern to use when filling in the foreground elements.
Return value
A view that uses the given foreground styles.
Discussion
SwiftUI uses these styles when rendering child views that don't have an explicit rendering style, like images, text, shapes, and so on.
Symbol images within the view hierarchy use the
SymbolRenderingMode.palette rendering mode when you apply this
modifier, if you don't explicitly specify another mode.
See also
More in Styles.
- arrangementViewStyleSets the style for arrangement views within this view.
- backgroundStyleSets the specified style to render backgrounds within the view.
- buttonStyleSets the style for buttons within this view to a button style with a custom appearance and custom interaction behavior.
- controlGroupStyleSets the style for control groups within this view.
- datePickerStyleSets the style for date pickers within this view.
- disclosureGroupStyleSets the style for disclosure groups within this view.
- formStyleSets the style for forms in a view hierarchy.
- gaugeStyleSets the style for gauges within this view.
- groupBoxStyleSets the style for group boxes within this view.
- indexViewStyleSets the style for the index view within the current environment.
- labeledContentStyleSets a style for labeled content.
- labelStyleSets the style for labels within this view.