---
title: numberOfColorComponents
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nscolorspacename/numberofcolorcomponents
---

# numberOfColorComponents

Returns the number of color components in the specified color space.

## Declaration

```swift
var numberOfColorComponents: Int { get }
```

## Discussion

Discussion Returns the number of color components in the color space whose name is provided by colorSpaceName.

## See Also

### Working with Window Depths

- [bitsPerPixel](appkit/nswindow/depth/bitsperpixel.md)
- [bitsPerSample](appkit/nswindow/depth/bitspersample.md)
- [colorSpaceName](appkit/nswindow/depth/colorspacename.md)
- [isPlanar](appkit/nswindow/depth/isplanar.md)
- [canRepresent(_:)](appkit/nswindow/canrepresent(_:).md)
