---
title: "usingColorSpaceName(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolor/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.

## Declaration

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

## Parameters

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

## Return Value

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

## See Also

### Related Documentation

- [colorSpaceName](appkit/nscolor/colorspacename.md)

### Deprecated

- [ignoresAlpha](appkit/nscolor/ignoresalpha.md)
- [colorSpaceName](appkit/nscolor/colorspacename.md)
- [usingColorSpaceName(_:device:)](appkit/nscolor/usingcolorspacename(_:device:).md)
- [currentControlTintDidChangeNotification](appkit/nscolor/currentcontroltintdidchangenotification.md)
