Sets the current fill color to a value in the DeviceCMYK color space.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Graphics
Declaration
Parameters
c
The graphics context for which to set the current fill color.
cyan
The cyan intensity value for the color to set. The DeviceCMYK color space permits the specification of a value ranging from 0.0 (does not absorb the secondary color) to 1.0 (fully absorbs the secondary color).
magenta
The magenta intensity value for the color to set. The DeviceCMYK color space permits the specification of a value ranging from 0.0 (does not absorb the secondary color) to 1.0 (fully absorbs the secondary color).
yellow
The yellow intensity value for the color to set. The DeviceCMYK color space permits the specification of a value ranging from 0.0 (does not absorb the secondary color) to 1.0 (fully absorbs the secondary color).
black
The black intensity value for the color to set. The DeviceCMYK color space permits the specification of a value ranging from 0.0 (does not absorb the secondary color) to 1.0 (fully absorbs the secondary color).
alpha
A value that specifies the opacity level. Values can range from
0
(transparent) to.0 1
(opaque). Values outside this range are clipped to.0 0
or.0 1
..0
Discussion
Core Graphics provides convenience functions for each of the device color spaces that allow you to set the fill or stroke color space and the fill or stroke color with one function call.
When you call this function, two things happen:
Core Graphics sets the current fill color space to DeviceCMYK.
Core Graphics sets the current fill color to the value specified by the
cyan
,magenta
,yellow
,black
, andalpha
parameters.