---
title: "init(composition:colorSpace:)"
framework: quartz
role: symbol
role_heading: Initializer
path: "quartz/qcrenderer/init(composition:colorspace:)"
---

# init(composition:colorSpace:)

Creates a  renderer object  with a composition object and a color space.

## Declaration

```swift
init!(composition: QCComposition!, colorSpace: CGColorSpace!)
```

## Parameters

- `composition`: A doc://com.apple.quartz/documentation/Quartz/QCComposition object. The composition must not contain any consumer patches. That is, the composition can receive data, process it, and produce output values, but it cannot perform any rendering.
- `colorSpace`: A Quartz color space object. This must be an RGB color space. Pass NULL to use the default RGB color space. The color space is used only for the images produced by the output image ports of the composition. For more information on Quartz color spaces, see https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001066.

## Return Value

Return Value The initialized QCRenderer object or nil if initialization is not successful.

## Discussion

Discussion Note that snapshotImage() and createSnapshotImage(ofType:) always returns nil on such QCRenderer instances.

## See Also

### Creating and Initializing a Renderer

- [init(openGLContext:pixelFormat:file:)](quartz/qcrenderer/init(openglcontext:pixelformat:file:).md)
- [init(cglContext:pixelFormat:colorSpace:composition:)](quartz/qcrenderer/init(cglcontext:pixelformat:colorspace:composition:)-7at42.md)
- [init(offScreenWith:colorSpace:composition:)](quartz/qcrenderer/init(offscreenwith:colorspace:composition:).md)
