setStrokeColor(gray:alpha:)
Sets the current stroke color to a value in the DeviceGray color space.
Declaration
func setStrokeColor(gray: CGFloat, alpha: CGFloat)Parameters
- gray:
A value that specifies the desired gray level. The DeviceGray color space permits the specification of a value ranging from
0.0(absolute black) to1.0(absolute white). Values outside this range are clamped to0.0or1.0. - alpha:
A value that specifies the opacity level. Values can range from
0.0(transparent) to1.0(opaque). Values outside this range are clipped to0.0or1.0.
Discussion
When you call this function, two things happen:
Core Graphics sets the current stroke color space to DeviceGray. The DeviceGray color space is a single-dimension space in which color values are specified solely by the intensity of a gray value (from absolute black to absolute white).
Core Graphics sets the current stroke color to the value you specify in the
grayandalphaparameters.
See Also
Setting Fill, Stroke, and Shadow Colors
setFillColor(_:)setFillColor(_:)setFillColor(cyan:magenta:yellow:black:alpha:)setFillColor(gray:alpha:)setFillColor(red:green:blue:alpha:)setFillColorSpace(_:)setShadow(offset:blur:)setShadow(offset:blur:color:)setStrokeColor(_:)setStrokeColor(_:)setStrokeColor(cyan:magenta:yellow:black:alpha:)setStrokeColor(red:green:blue:alpha:)setStrokeColorSpace(_:)setStrokePattern(_:colorComponents:)setAlpha(_:)