<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ShapeStyle/radialGradient(_:center:startRadius:endRadius:)-2blwe",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10ShapeStylePA2A14RadialGradientVRszrlE06radialF0_6center11startRadius03endJ0QrAA03AnyF0V_AA9UnitPointV14CoreFoundation7CGFloatVAPtFZ"
  },
  "title" : "radialGradient(_:center:startRadius:endRadius:)"
}
-->

# radialGradient(_:center:startRadius:endRadius:)

A radial gradient.

```
@export(implementation) static func radialGradient(_ gradient: AnyGradient, center: UnitPoint = .center, startRadius: CGFloat = 0, endRadius: CGFloat) -> some ShapeStyle
```

## Discussion

The gradient applies the color function as the distance from a
center point, scaled to fit within the defined start and end
radii. The gradient maps the unit space center point into the
bounding rectangle of each shape filled with the gradient.

For example, a radial gradient used as a background:

```
ContentView()
    .background(.radialGradient(.red.gradient, endRadius: 100))
```

For information about how to use shape styles, see `ShapeStyle`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)