<!--
{
  "availability" : [
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSCollectionViewGridLayout/backgroundColors",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSCollectionViewGridLayout(py)backgroundColors"
  },
  "title" : "backgroundColors"
}
-->

# backgroundColors

The array of background colors to use when drawing the grid.

```
var backgroundColors: [NSColor]! { get set }
```

## Discussion

The [`NSColor`](/documentation/AppKit/NSColor) objects in this property are used to draw the grid’s background. The appearance of the background depends on the value you specify:

- Specifying `nil` fills the background with the collection view’s default background color.
- Specifying an empty array causes the collection view to draw no background color.
- Specifying an array with one color object fills the background with the specified color.
- Specifying an array with more than one color object causes the collection view to use the specified colors to create a checkerboard pattern. Each successive grid item is displayed with the next color in the array, cycling back to the beginning of the array when the last color is reached.

The default value of this property is `nil`.

---

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)