shadow(_:)
Returns a shape style that applies the specified shadow style to the current style.
Declaration
static func shadow(_ style: ShadowStyle) -> some ShapeStyle
Parameters
- style:
The shadow style to apply.
Return Value
A new shape style based on the current style that uses the specified shadow style.
Discussion
In most contexts the current style is the foreground, but not always. For example, when setting the value of the background style, that becomes the current implicit style.
The following example creates a circle filled with the current foreground style that uses an inner shadow:
Circle().fill(.shadow(.inner(radius: 1, y: 1)))