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

# NSDrawColorTiledRects(_:_:_:_:_:)

Draws a single-color, bordered rectangle.

```
func NSDrawColorTiledRects(_ boundsRect: NSRect, _ clipRect: NSRect, _ sides: UnsafePointer<NSRectEdge>, _ colors: AutoreleasingUnsafeMutablePointer<NSColor>, _ count: Int) -> NSRect
```

## Parameters

`boundsRect`

The bounding rectangle (in the current coordinate system) in which to draw. Since this function is often used to draw the border of a view, this rectangle will typically be that view’s bounds rectangle. Only those parts of `boundsRect` that lie within the `clipRect` are actually drawn.

`clipRect`

The clipping rectangle to use during drawing.

`sides`

The sides of the rectangle for which you want to specify custom colors. Each side must have a corresponding entry in the `colors` parameter.

`colors`

The colors to draw for each of the edges listed in the `sides` parameter.

`count`

The number of 1.0-unit-wide slices to draw on the specified sides.

## Return Value

The rectangle that lies within the resulting border.

## Discussion

Behaves the same as [`NSDrawTiledRects(_:_:_:_:_:)`](/documentation/AppKit/NSDrawTiledRects(_:_:_:_:_:)) except it draws its border using colors from the `colors` array.

---

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)