Function

CGContextSetCMYKStrokeColor

Sets the current stroke color to a value in the DeviceCMYK color space.

Declaration

void CGContextSetCMYKStrokeColor(CGContextRef c, CGFloat cyan, CGFloat magenta, CGFloat yellow, CGFloat black, CGFloat alpha);

Parameters

c

The graphics context for which to set the current stroke 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.0 (transparent) to 1.0 (opaque). Values outside this range are clipped to 0.0 or 1.0.

Discussion

When you call this function, two things happen:

  • Core Graphics sets the current stroke color space to DeviceCMYK.

  • Core Graphics sets the current stroke color to the value specified by the cyan, magenta, yellow, black, and alpha parameters.

See Also

Setting Color, Color Space, and Shadow Values

CGContextSetAlpha

Sets the opacity level for objects drawn in a graphics context.

CGContextSetCMYKFillColor

Sets the current fill color to a value in the DeviceCMYK color space.

CGContextSetFillColor

Sets the current fill color.

CGContextSetFillColorSpace

Sets the fill color space in a graphics context.

CGContextSetFillColorWithColor

Sets the current fill color in a graphics context, using a CGColor.

CGContextSetGrayFillColor

Sets the current fill color to a value in the DeviceGray color space.

CGContextSetGrayStrokeColor

Sets the current stroke color to a value in the DeviceGray color space.

CGContextSetRGBFillColor

Sets the current fill color to a value in the DeviceRGB color space.

CGContextSetRGBStrokeColor

Sets the current stroke color to a value in the DeviceRGB color space.

CGContextSetShadow

Enables shadowing in a graphics context.

CGContextSetShadowWithColor

Enables shadowing with color a graphics context.

CGContextSetStrokeColor

Sets the current stroke color.

CGContextSetStrokeColorSpace

Sets the stroke color space in a graphics context.

CGContextSetStrokeColorWithColor

Sets the current stroke color in a context, using a CGColor.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software