---
title: "fill(_:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsbezierpath/fill(_:)"
---

# fill(_:)

Fills the specified rectangular path with the current fill color.

## Declaration

```swift
class func fill(_ rect: NSRect)
```

## Parameters

- `rect`: A rectangle in the current coordinate system.

## Discussion

Discussion This method fills the specified region immediately. This method uses the compositing operation returned by the compositingOperation method of NSGraphicsContext.

## See Also

### Related Documentation

- [set()](appkit/nscolor/set().md)
- [init(rect:)](appkit/nsbezierpath/init(rect:).md)
- [appendRect(_:)](appkit/nsbezierpath/appendrect(_:).md)
- [compositingOperation](appkit/nsgraphicscontext/compositingoperation.md)

### Drawing a Path

- [stroke()](appkit/nsbezierpath/stroke().md)
- [fill()](appkit/nsbezierpath/fill().md)
- [stroke(_:)](appkit/nsbezierpath/stroke(_:).md)
- [strokeLine(from:to:)](appkit/nsbezierpath/strokeline(from:to:).md)
- [drawPackedGlyphs(_:at:)](appkit/nsbezierpath/drawpackedglyphs(_:at:).md)
