---
title: backgroundColors
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nscollectionview/backgroundcolors
---

# backgroundColors

An array containing the collection view’s background colors.

## Declaration

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

## Discussion

Discussion This property contains an array of NSColor objects, representing the colors to use when drawing the background grid. Specifying an empty array or nil causes the collection view to use the default colors returned by the controlAlternatingRowBackgroundColors method. When a background view is specified for the collection view, the colors in this property are ignored.

## See Also

### Configuring the Collection View

- [delegate](appkit/nscollectionview/delegate.md)
- [NSCollectionViewDelegate](appkit/nscollectionviewdelegate.md)
- [content](appkit/nscollectionview/content.md)
- [backgroundView](appkit/nscollectionview/backgroundview.md)
- [backgroundViewScrollsWithContent](appkit/nscollectionview/backgroundviewscrollswithcontent.md)
