setAlpha(_:)
Sets the opacity level for objects drawn in a graphics context.
Declaration
func setAlpha(_ alpha: CGFloat)Parameters
- 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
This function sets the alpha value parameter for the specified graphics context. To clear the contents of the drawing canvas, use clear(_:).
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(gray:alpha:)setStrokeColor(red:green:blue:alpha:)setStrokeColorSpace(_:)setStrokePattern(_:colorComponents:)