---
title: CMSetDefaultProfileBySpace
framework: Application Services
role: pseudoSymbol
platforms: []
path: applicationservices/colorsync_manager/1804944-cmsetdefaultprofilebyspace
---

# CMSetDefaultProfileBySpace

Sets the default profile for the specified color space.

## Declaration

```occ
CMError CMSetDefaultProfileBySpace (
   OSType dataColorSpace,
   CMProfileRef prof
);
```

## Parameters

- `dataColorSpace`: A four-character identifier of type `OSType`. You pass a color space signature that identifies the color space you wish to set the default profile for. The currently-supported values are `cmRGBData`, `cmCMYKData`, `cmLabData`, and `cmXYZData`. These constants are a subset of the constants described in [doc://com.apple.documentation/documentation/applicationservices/1560276-color_space_signatures](applicationservices/1560276-color_space_signatures.md). If you supply a value that is not supported, the `CMGetDefaultProfileBySpace` function returns an error value of `paramErr`.
- `prof`: A profile reference. Before calling `CMSetDefaultProfileBySpace`, set the reference to specify the default profile for the color space. The profile must be file-based; otherwise, the function returns a `CMInvalidProfileLocation` error.

## Return Value

A `CMError` value. See [Result Codes](../colorsync_manager.md).

## Overview

The `CMSetDefaultProfileBySpace` function currently supports the RGB, CMYK, Lab, and XYZ color spaces. The signature constants for these color spaces (shown above with the `dataColorSpace` parameter description) are described in [Color Space Signatures](../1560276-color_space_signatures.md). Support for additional color spaces may be provided in the future. `CMSetDefaultProfileBySpace` returns a value of `paramErr` if you pass a color space constant it does not currently support.

Note that a user can also use the ColorSync control panel to specify a default profile for the RGB and CMYK color spaces. 

## See Also

### Accessing Special Profiles

- [CMGetSystemProfile](1804926-cmgetsystemprofile.md)
- [CMSetSystemProfile](1804932-cmsetsystemprofile.md)
- [NCMSetSystemProfile](1804936-ncmsetsystemprofile.md)
- [CMGetDefaultProfileBySpace](1804940-cmgetdefaultprofilebyspace.md)
- [CMGetDefaultProfileByUse](1804948-cmgetdefaultprofilebyuse.md)
- [CMSetDefaultProfileByUse](1804951-cmsetdefaultprofilebyuse.md)
- [CMGetProfileByAVID](1804955-cmgetprofilebyavid.md)
- [CMSetProfileByAVID](1804959-cmsetprofilebyavid.md)
