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

# usingColorSpaceName(_:device:)

Creates a new color object for the same color, but in the specified color space and specific to the provided device.

```
func usingColorSpaceName(_ name: NSColorSpaceName?, device deviceDescription: [NSDeviceDescriptionKey : Any]?) -> NSColor?
```

## Parameters

`name`

The name of the color space containing the new `NSColor` object. If `colorSpace` is `nil`, the most appropriate color space is used.

`deviceDescription`

The device description. Device descriptions can be obtained from windows, screens, and printers with the `deviceDescription` method.

    If     `deviceDescription`     is     `nil`    , the current device (as obtained from the currently lockFocus’ed view’s window or, if printing, the current printer) is used.

## 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)