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

# numberOfColorComponents

The number of components, excluding alpha, the color space supports.

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

## Discussion

This value is `0` if the color space isn’t based on `float` components.

---

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)