---
title: "usingColorSpace(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nscolor/usingcolorspace(_:)"
---

# usingColorSpace(_:)

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

## Declaration

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

## Parameters

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

## Return Value

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

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

## See Also

### Related Documentation

- [init(colorSpace:components:count:)](appkit/nscolor/init(colorspace:components:count:).md)

### Transforming existing color objects

- [blended(withFraction:of:)](appkit/nscolor/blended(withfraction:of:).md)
- [withAlphaComponent(_:)](appkit/nscolor/withalphacomponent(_:).md)
- [highlight(withLevel:)](appkit/nscolor/highlight(withlevel:).md)
- [shadow(withLevel:)](appkit/nscolor/shadow(withlevel:).md)
