setShadow(offset:blur:)
Enables shadowing in a graphics context.
Declaration
func setShadow(offset: CGSize, blur: CGFloat)Parameters
- offset:
Specifies a translation of the context’s coordinate system, to establish an offset for the shadow (
{0,0}specifies a light source immediately above the screen). - blur:
A non-negative number specifying the amount of blur.
Discussion
Shadow parameters are part of the graphics state in a context. After shadowing is set, all objects drawn are shadowed using a black color with 1/3 alpha (in effect, RGBA = {0, 0, 0, 1.0/3.0}) in the DeviceRGB color space.
To turn off shadowing:
Use the standard save/restore mechanism for the graphics state.
Use setShadow(offset:blur:color:) to set the shadow color to a fully transparent color (or pass
NULLas the color).
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:color:)setStrokeColor(_:)setStrokeColor(_:)setStrokeColor(cyan:magenta:yellow:black:alpha:)setStrokeColor(gray:alpha:)setStrokeColor(red:green:blue:alpha:)setStrokeColorSpace(_:)setStrokePattern(_:colorComponents:)setAlpha(_:)