---
title: "init(name:)"
framework: coregraphics
role: symbol
role_heading: Initializer
path: "coregraphics/cgcolorspace/init(name:)"
---

# init(name:)

Creates a specified type of Quartz color space.

## Declaration

```swift
init?(name: CFString)
```

## Parameters

- `name`: A color space name. See doc://com.apple.coregraphics/documentation/CoreGraphics/CGColorSpace#Accessing-System-Defined-Color-Spaces for a list of the valid Quartz-defined names.

## Return Value

Return Value A new generic color space, or NULL if unsuccessful. In Objective-C, you’re responsible for releasing this object by calling CGColorSpaceRelease.

## Discussion

Discussion You can use this function to create a generic color space. For more information, see Accessing System-Defined Color Spaces.

## See Also

### Related Documentation

- [name](coregraphics/cgcolorspace/name.md)

### Creating Color Spaces

- [init(calibratedGrayWhitePoint:blackPoint:gamma:)](coregraphics/cgcolorspace/init(calibratedgraywhitepoint:blackpoint:gamma:).md)
- [init(calibratedRGBWhitePoint:blackPoint:gamma:matrix:)](coregraphics/cgcolorspace/init(calibratedrgbwhitepoint:blackpoint:gamma:matrix:).md)
- [init(iccBasedNComponents:range:profile:alternate:)](coregraphics/cgcolorspace/init(iccbasedncomponents:range:profile:alternate:).md)
- [init(indexedBaseSpace:last:colorTable:)](coregraphics/cgcolorspace/init(indexedbasespace:last:colortable:).md)
- [init(labWhitePoint:blackPoint:range:)](coregraphics/cgcolorspace/init(labwhitepoint:blackpoint:range:).md)
- [init(patternBaseSpace:)](coregraphics/cgcolorspace/init(patternbasespace:).md)
- [init(platformColorSpaceRef:)](coregraphics/cgcolorspace/init(platformcolorspaceref:).md)
- [init(iccData:)](coregraphics/cgcolorspace/init(iccdata:).md)
- [init(propertyListPlist:)](coregraphics/cgcolorspace/init(propertylistplist:).md)
- [CGColorSpaceCreateDeviceRGB()](coregraphics/cgcolorspacecreatedevicergb().md)
- [CGColorSpaceCreateDeviceCMYK()](coregraphics/cgcolorspacecreatedevicecmyk().md)
- [CGColorSpaceCreateDeviceGray()](coregraphics/cgcolorspacecreatedevicegray().md)
- [init(iccProfileData:)](coregraphics/cgcolorspace/init(iccprofiledata:).md)
