---
title: "fill(using:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/sequence/fill(using:)-45en6"
---

# fill(using:)

Fills this list of rects in the current NSGraphicsContext with that rect’s associated color The compositing operation of the fill defaults to the context’s compositing operation, not necessarily using .copy like NSRectFill().

## Declaration

```swift
func fill(using operation: NSCompositingOperation = NSGraphicsContext.current?.compositingOperation ?? .sourceOver)
```

## Discussion

Discussion note: There must be a set current NSGraphicsContext.

## See Also

### Applying AppKit Graphic Operations

- [fill(using:)](swift/sequence/fill(using:)-l1te.md)
- [clip()](swift/sequence/clip().md)
