Declaration
compose().blendMode(blendMode: SwiftUI.BlendMode)nonisolated func blendMode(_ blendMode: BlendMode) -> some ViewParameters
blendMode*SwiftUI.BlendModeThe
BlendModefor compositing this view.
Return value
A view that applies blendMode to this view.
Discussion
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
BlendMode.colorBurn effect applied, which effectively removes the
non-overlapping portion of the second image:
HStack {
Color.yellow.frame(width: 50, height: 50, alignment: .center)
Color.red.frame(width: 50, height: 50, alignment: .center)
.rotationEffect(.degrees(45))
.padding(-20)
.blendMode(.colorBurn)
}See also
More in Drawing and shapes.
- buttonBorderShapeSets the border shape for buttons in this view.
- clipShapeSets a clipping shape for this view.
- containerShapeSets the container shape to use for any container relative shape within this view.
- contentShapeSets the content shape for this view.
- coordinateSpaceAssigns a name to the view's coordinate space, so other code can operate on dimensions like points and sizes relative to the named space.
- materialActiveAppearanceSets an explicit active appearance for materials in this view.
- textInputBorderShapeSets the border shape for text input controls in the view hierarchy.