<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGradient/draw(fromCenter:radius:toCenter:radius:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGradient(im)drawFromCenter:radius:toCenter:radius:options:"
  },
  "title" : "draw(fromCenter:radius:toCenter:radius:options:)"
}
-->

# draw(fromCenter:radius:toCenter:radius:options:)

Draws a radial gradient between the specified circles.

```
func draw(fromCenter startCenter: NSPoint, radius startRadius: CGFloat, toCenter endCenter: NSPoint, radius endRadius: CGFloat, options: NSGradient.DrawingOptions = [])
```

## Parameters

`startCenter`

The center point of the circle that represents the beginning of the gradient.

`startRadius`

The radius of the circle that represents the beginning of the gradient.

`endCenter`

The center point of the circle that represents the end of the gradient.

`endRadius`

The radius of the circle that represents the end of the gradient.

`options`

The gradient options, if any. You can use these options to extend the gradient size beyond the start and end circles. For more information, see [`NSGradient.DrawingOptions`](/documentation/AppKit/NSGradient/DrawingOptions).

## Discussion

This method draws a radial gradient pattern starting at the first circle and ending at the second circle. The gradient color transitions occur in circular bands emanating from the starting circle and ending at the second circle.

This is a primitive method used by the `NSGradient` class to draw radial gradients. Because this method does not perform any clipping of the gradient fill pattern, you must ensure that the clipping region is configured properly if you intend to invoke this method directly. By default, the clipping region is set to the current view or window in which drawing occurs.

---

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)