---
title: numberOfComponents
framework: coreimage
role: symbol
role_heading: Instance Property
path: coreimage/cicolor/numberofcomponents
---

# numberOfComponents

Returns the color components of the color including alpha.

## Declaration

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

## Discussion

Discussion This number includes the alpha component if the color contains one. Typically this number will be 4 for red, green, blue, and alpha. If the CIColor was initialized with a CGColor then the number will be the same as calling CGColorGetNumberOfComponents()

## See Also

### Getting Color Components

- [colorSpace](coreimage/cicolor/colorspace.md)
- [components](coreimage/cicolor/components.md)
- [red](coreimage/cicolor/red-swift.property.md)
- [green](coreimage/cicolor/green-swift.property.md)
- [blue](coreimage/cicolor/blue-swift.property.md)
- [alpha](coreimage/cicolor/alpha.md)
- [stringRepresentation](coreimage/cicolor/stringrepresentation.md)
