---
title: "drawRadialGradient(_:startCenter:startRadius:endCenter:endRadius:options:)"
framework: coregraphics
role: symbol
role_heading: Instance Method
path: "coregraphics/cgcontext/drawradialgradient(_:startcenter:startradius:endcenter:endradius:options:)"
---

# drawRadialGradient(_:startCenter:startRadius:endCenter:endRadius:options:)

Paints a gradient fill that varies along the area defined by the provided starting and ending circles.

## Declaration

```swift
func drawRadialGradient(_ gradient: CGGradient, startCenter: CGPoint, startRadius: CGFloat, endCenter: CGPoint, endRadius: CGFloat, options: CGGradientDrawingOptions)
```

## Parameters

- `gradient`: A CGGradient object.
- `startCenter`: The coordinate that defines the center of the starting circle.
- `startRadius`: The radius of the starting circle.
- `endCenter`: The coordinate that defines the center of the ending circle.
- `endRadius`: The radius of the ending circle.
- `options`: Option flags (doc://com.apple.coregraphics/documentation/CoreGraphics/CGGradientDrawingOptions/drawsBeforeStartLocation or doc://com.apple.coregraphics/documentation/CoreGraphics/CGGradientDrawingOptions/drawsAfterEndLocation) that control whether the gradient is drawn before the starting circle or after the ending circle.

## Discussion

Discussion The color at location 0 in the CGGradient object is mapped to the circle defined by startCenter and startRadius. The color at location 1 in the CGGradient object is mapped to the circle defined by endCenter and endRadius. Colors are linearly interpolated between the starting and ending circles based on the location values of the gradient. The option flags control whether the gradient is drawn before the start point or after the end point.

## See Also

### Drawing Gradients and Shadings

- [drawLinearGradient(_:start:end:options:)](coregraphics/cgcontext/drawlineargradient(_:start:end:options:).md)
- [CGGradientDrawingOptions](coregraphics/cggradientdrawingoptions.md)
- [drawShading(_:)](coregraphics/cgcontext/drawshading(_:).md)
