---
title: NSRectFill
framework: appkit
role: symbol
role_heading: Function
path: appkit/nsrectfill
---

# NSRectFill

Fills the passed rectangle with the current color.

## Declaration

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

## Parameters

- `rect`: The bounding rectangle (in the current coordinate system) in which to draw.

## Discussion

Discussion Fills aRect with the current color using the compositing mode NSCompositingOperation.copy, which fills with the current color by copying the RGBA values. Use NSRectFillUsingOperation to fill specifying a compositing mode. For more information, see NSCompositingOperation.

## See Also

### Drawing Rectangles

- [NSFrameRect](appkit/nsframerect.md)
- [NSFrameRectWithWidth](appkit/nsframerectwithwidth.md)
- [NSFrameRectWithWidthUsingOperation](appkit/nsframerectwithwidthusingoperation.md)
- [NSEraseRect(_:)](appkit/nseraserect(_:).md)
- [NSRectFillList](appkit/nsrectfilllist.md)
- [NSRectFillListUsingOperation](appkit/nsrectfilllistusingoperation.md)
- [NSRectFillListWithColors](appkit/nsrectfilllistwithcolors.md)
- [NSRectFillListWithColorsUsingOperation](appkit/nsrectfilllistwithcolorsusingoperation.md)
- [NSRectFillListWithGrays](appkit/nsrectfilllistwithgrays.md)
- [NSRectFillUsingOperation](appkit/nsrectfillusingoperation.md)
- [NSDrawTiledRects(_:_:_:_:_:)](appkit/nsdrawtiledrects(_:_:_:_:_:).md)
- [NSDrawGroove(_:_:)](appkit/nsdrawgroove(_:_:).md)
- [NSHighlightRect](appkit/nshighlightrect.md)
