Instance Method


Sets the blend mode for compositing this view with overlapping views.


func blendMode(_ blendMode: BlendMode) -> some View



The BlendMode for compositing this view.

Return Value

A view that applies blendMode to this view.


Use blendMode(_:) to combine overlapping views and use a different visual effect to produce the result. The BlendMode enumeration defines many possible effects.

In the example below, the two overlapping rectangles have a .colorBurn effect applied, which effectively removes the non-overlapping portion of the second image:

HStack {
    Color.yellow.frame(width: 50, height: 50, alignment: .center) 50, height: 50, alignment: .center)
Two overlapping rectangles showing the effect of the blend mode view modifier applying the colorBurn effect.

See Also

Compositing Views

enum BlendMode

Modes for compositing a view with overlapping content.

func compositingGroup() -> View

Wraps this view in a compositing group.

func drawingGroup(opaque: Bool, colorMode: ColorRenderingMode) -> View

Composites this view’s contents into an offscreen image before final display.

enum ColorRenderingMode

The working color space for color-compositing operations.