<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGColorSpace/init(name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Core Graphics",
      "CoreGraphics"
    ],
    "preciseIdentifier" : "c:@F@CGColorSpaceCreateWithName"
  },
  "title" : "init(name:)"
}
-->

# init(name:)

Creates a specified type of Quartz color space.

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

## Parameters

`name`

A color space name. See [`Accessing System-Defined Color Spaces`](/documentation/CoreGraphics/CGColorSpace#Accessing-System-Defined-Color-Spaces) for a list of the valid Quartz-defined names.

## Return Value

A new generic color space, or `NULL` if unsuccessful. In Objective-C, you’re responsible for releasing this object by calling [`CGColorSpaceRelease`](/documentation/CoreGraphics/CGColorSpaceRelease).

## Discussion

You can use this function to create a generic color space. For more information, see [`Accessing System-Defined Color Spaces`](/documentation/CoreGraphics/CGColorSpace#Accessing-System-Defined-Color-Spaces).

## See Also

[`name`](/documentation/CoreGraphics/CGColorSpace/name)

Returns the name used to create the specified color space.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)