---
title: CGColorSpaceRetain
framework: coregraphics
role: symbol
role_heading: Function
path: coregraphics/cgcolorspaceretain
---

# CGColorSpaceRetain

Increments the retain count of a color space.

## Declaration

```occ
extern CGColorSpaceRefCGColorSpaceRetain(CGColorSpaceRef space);
```

## Parameters

- `space`: The Quartz color space to retain.

## Return Value

Return Value The same color space you passed in as the space parameter.

## Discussion

Discussion This function is equivalent to CFRetain, except that it does not cause an error if the cs parameter is NULL.

## See Also

### Retaining and Releasing Color Spaces

- [CGColorSpaceRelease](coregraphics/cgcolorspacerelease.md)
