<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGradient/draw(in:angle:)-68adz",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGradient(im)drawInBezierPath:angle:"
  },
  "title" : "draw(in:angle:)"
}
-->

# draw(in:angle:)

Fills the specified path with a linear gradient.

```
func draw(in path: NSBezierPath, angle: CGFloat)
```

## Parameters

`path`

The path object to fill.

`angle`

The angle of the linear gradient, specified in degrees. Positive values indicate rotation in the counter-clockwise direction relative to the horizontal axis.

## Discussion

This convenience method behaves in a similar way to the [`draw(in:angle:)`](/documentation/AppKit/NSGradient/draw(in:angle:)-7sdyh) method, with the path object replacing the rectangle as the clipping region. Like the other method, the start and end colors are guaranteed to be visible at the farthest ends of the path.

The gradient formed by this method is clipped to `path`.

---

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)