---
title: CGColorRetain
framework: coregraphics
role: symbol
role_heading: Function
path: coregraphics/cgcolorretain
---

# CGColorRetain

Increments the retain count of a color.

## Declaration

```occ
extern CGColorRefCGColorRetain(CGColorRef color);
```

## Parameters

- `color`: The color to retain.

## Return Value

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

## Discussion

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

## See Also

### Retaining and Releasing Color Objects

- [CGColorRelease](coregraphics/cgcolorrelease.md)
