---
title: colorSpace
framework: appkit
role: symbol
role_heading: Instance Property
path: appkit/nsgradient/colorspace
---

# colorSpace

The color space of the colors associated with the gradient.

## Declaration

```swift
var colorSpace: NSColorSpace { get }
```

## Discussion

Discussion When the receiver is initialized, colors that do not conform to the receiver’s color space are converted automatically.

## See Also

### Getting Gradient Properties

- [numberOfColorStops](appkit/nsgradient/numberofcolorstops.md)
- [getColor(_:location:at:)](appkit/nsgradient/getcolor(_:location:at:).md)
- [interpolatedColor(atLocation:)](appkit/nsgradient/interpolatedcolor(atlocation:).md)
