<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSRectFill",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@F@NSRectFill"
  },
  "title" : "NSRectFill"
}
-->

# NSRectFill

Fills the passed rectangle with the current color.

```
extern void NSRectFill(NSRect rect);
```

## Parameters

`rect`

The bounding rectangle (in the current coordinate system) in which to draw.

## Discussion

Fills `aRect` with the current color using the compositing mode [`NSCompositingOperation.copy`](/documentation/AppKit/NSCompositingOperation/copy), which fills with the current color by copying the RGBA values. Use [`NSRectFillUsingOperation`](/documentation/AppKit/NSRectFillUsingOperation) to fill specifying a compositing mode.

For more information, see [`NSCompositingOperation`](/documentation/AppKit/NSCompositingOperation).

---

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)