<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ShapeStyle/angularGradient(_:center:startAngle:endAngle:)-378tu",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10ShapeStylePA2A15AngularGradientVRszrlE07angularF0_6center10startAngle03endJ0AeA0F0V_AA9UnitPointVAA0J0VAOtFZ"
  },
  "title" : "angularGradient(_:center:startAngle:endAngle:)"
}
-->

# angularGradient(_:center:startAngle:endAngle:)

An angular gradient, which applies the color function as the angle
changes between the start and end angles, and anchored to a relative
center point within the filled shape.

```
@export(implementation) static func angularGradient(_ gradient: Gradient, center: UnitPoint, startAngle: Angle, endAngle: Angle) -> AngularGradient
```

## Parameters

`gradient`

The gradient to use for filling the shape, providing the
colors and their relative stop locations.

`center`

The relative center of the gradient, mapped from the unit
space into the bounding rectangle of the filled shape.

`startAngle`

The angle that marks the beginning of the gradient.

`endAngle`

The angle that marks the end of the gradient.

## Discussion

An angular gradient is also known as a “conic” gradient. If
`endAngle - startAngle > 2π`, the gradient only draws the last complete
turn. If `endAngle - startAngle < 2π`, the gradient fills the missing
area with the colors defined by gradient stop locations at `0` and `1`,
transitioning between the two halfway across the missing area.

For example, an angular gradient used as a background:

```
let gradient = Gradient(colors: [.red, .yellow])

ContentView()
    .background(.angularGradient(gradient))
```

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)