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

# usingColorSpace(_:)

Creates a new color object representing the color of the current color object in the specified color space.

```
func usingColorSpace(_ space: NSColorSpace) -> NSColor?
```

## Parameters

`space`

The color space of the new `NSColor` object.

## Return Value

The new `NSColor` object. This method converts the receiver’s color to an equivalent one in the new color space. Although the new color might have different component values, it looks the same as the original.  Returns `nil` if conversion is not possible.

## Discussion

If the receiver’s color space is the same as that specified in `space`, this method returns the same `NSColor` object.

## See Also

[`init(colorSpace:components:count:)`](/documentation/AppKit/NSColor/init(colorSpace:components:count:))

Creates a color object from the specified components of the given 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)