---
title: copy()
framework: coregraphics
role: symbol
role_heading: Instance Method
path: coregraphics/cgcolor/copy()
---

# copy()

Creates a copy of an existing color.

## Declaration

```swift
func copy() -> CGColor?
```

## Return Value

Return Value A copy of the specified color. In Objective-C, you’re responsible for releasing this object using CGColorRelease.

## See Also

### Creating Colors

- [copy(alpha:)](coregraphics/cgcolor/copy(alpha:).md)
- [init(genericCMYKCyan:magenta:yellow:black:alpha:)](coregraphics/cgcolor/init(genericcmykcyan:magenta:yellow:black:alpha:).md)
- [init(gray:alpha:)](coregraphics/cgcolor/init(gray:alpha:).md)
- [init(genericGrayGamma2_2Gray:alpha:)](coregraphics/cgcolor/init(genericgraygamma2_2gray:alpha:).md)
- [init(red:green:blue:alpha:)](coregraphics/cgcolor/init(red:green:blue:alpha:).md)
- [init(srgbRed:green:blue:alpha:)](coregraphics/cgcolor/init(srgbred:green:blue:alpha:).md)
- [init(colorSpace:components:)](coregraphics/cgcolor/init(colorspace:components:).md)
- [init(patternSpace:pattern:components:)](coregraphics/cgcolor/init(patternspace:pattern:components:).md)
