<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.14.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSColor/usingColorSpaceName(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSColor(im)colorUsingColorSpaceName:"
  },
  "title" : "usingColorSpaceName(_:)"
}
-->

# usingColorSpaceName(_:)

Creates a new color object whose color is the same as the receiver’s, except that the new color object is in the specified color space.

```
func usingColorSpaceName(_ name: NSColorSpaceName) -> NSColor?
```

## Parameters

`name`

The name of the color space containing the new `NSColor` object.

## Return Value

The new `NSColor` object or `nil` if the specified conversion cannot be done.

## See Also

[`colorSpaceName`](/documentation/AppKit/NSColor/colorSpaceName)

The name of the color space associated with the color.



---

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)