---
title: "init(platformColorSpaceRef:)"
framework: coregraphics
role: symbol
role_heading: Initializer
path: "coregraphics/cgcolorspace/init(platformcolorspaceref:)"
---

# init(platformColorSpaceRef:)

Creates a platform-specific color space.

## Declaration

```swift
init?(platformColorSpaceRef ref: UnsafeRawPointer)
```

## Parameters

- `ref`: A generic pointer to a platform-specific color space. In macOS, pass a ColorSyncProfileRef, which is a ColorSync profile. Quartz uses this pointer (and the underlying information) only during the function call.

## Return Value

Return Value A new color space, or NULL if unsuccessful. In Objective-C, you’re responsible for releasing this object by calling CGColorSpaceRelease.

## Discussion

Discussion Colors in a device-dependent color space are not transformed or otherwise modified when displayed on an output device — that is, there is no attempt to maintain the visual appearance of a color. As a consequence, colors in a device color space often appear different when displayed on different output devices. For this reason, device color spaces are not recommended when color preservation is important.

## See Also

### Creating Color Spaces

- [init(calibratedGrayWhitePoint:blackPoint:gamma:)](coregraphics/cgcolorspace/init(calibratedgraywhitepoint:blackpoint:gamma:).md)
- [init(calibratedRGBWhitePoint:blackPoint:gamma:matrix:)](coregraphics/cgcolorspace/init(calibratedrgbwhitepoint:blackpoint:gamma:matrix:).md)
- [init(iccBasedNComponents:range:profile:alternate:)](coregraphics/cgcolorspace/init(iccbasedncomponents:range:profile:alternate:).md)
- [init(indexedBaseSpace:last:colorTable:)](coregraphics/cgcolorspace/init(indexedbasespace:last:colortable:).md)
- [init(labWhitePoint:blackPoint:range:)](coregraphics/cgcolorspace/init(labwhitepoint:blackpoint:range:).md)
- [init(patternBaseSpace:)](coregraphics/cgcolorspace/init(patternbasespace:).md)
- [init(name:)](coregraphics/cgcolorspace/init(name:).md)
- [init(iccData:)](coregraphics/cgcolorspace/init(iccdata:).md)
- [init(propertyListPlist:)](coregraphics/cgcolorspace/init(propertylistplist:).md)
- [CGColorSpaceCreateDeviceRGB()](coregraphics/cgcolorspacecreatedevicergb().md)
- [CGColorSpaceCreateDeviceCMYK()](coregraphics/cgcolorspacecreatedevicecmyk().md)
- [CGColorSpaceCreateDeviceGray()](coregraphics/cgcolorspacecreatedevicegray().md)
- [init(iccProfileData:)](coregraphics/cgcolorspace/init(iccprofiledata:).md)
