fill

Fills this shape with a color or gradient.

Shape ModifieriOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+

Overloads

3 ways to call compose().fill(). Each is one SwiftUI overload, picked by the arguments you pass.

React
compose().fill(
  content?: SwiftUI.ShapeStyle,
  options?: {
    style?: SwiftUI.FillStyle;
  }
)
Swift
@export(implementation) nonisolated func fill<S>(
    _ content: S = .foreground,
    style: FillStyle = FillStyle()
) -> _ShapeView<Self, S>
where S : ShapeStyle

Parameters

Return value

A shape filled with the color or gradient you supply.

See also

More in Shape modifiers.