Instance Method

blur(radius:opaque:)

Applies a Gaussian blur to the view.

Declaration

func blur(radius: CGFloat, opaque: Bool = false) -> some View

Parameters

radius

The radial size of the blur. A blur is more diffuse when its radius is large.

opaque

A Boolean value that indicates whether the blur renderer permits transparency in the blur output. Set to true to create an opaque blur, or set to false to permit transparency.

Discussion

The following shows two versions of the same image side by side; at left is the original, and at right is a duplicate with its blur radius set to 10:

See Also

Applying Graphical Effects to a View

func opacity(Double) -> View

Sets the transparency of the view.

func brightness(Double) -> View

Brightens the view by the specified amount.

func contrast(Double) -> View

Sets the contrast and separation between similar colors in the view.

func colorInvert() -> View

Inverts the colors in the view.

func colorMultiply(Color) -> View

Adds a color multiplication effect to the view.

func saturation(Double) -> View

Adjusts the color saturation of the view.

func grayscale(Double) -> View

Adds a grayscale effect to the view.

func hueRotation(Angle) -> View

Applies a hue rotation effect to the view.

func luminanceToAlpha() -> View

Adds a luminance to alpha effect to the view.