---
title: xor
framework: swiftui
role: symbol
role_heading: Type Property
path: swiftui/graphicscontext/blendmode-swift.struct/xor
---

# xor

A mode that you use to clear pixels where both the source and background images are opaque.

## Declaration

```swift
static var xor: GraphicsContext.BlendMode { get }
```

## Discussion

Discussion This mode implements the equation R = S*(1 - Da) + D*(1 - Sa) where R is the composite image. S is the source image. D is the background. Sa is the source image’s alpha value. Da is the source background’s alpha value. This XOR mode is only nominally related to the classical bitmap XOR operation, which SwiftUI doesn’t support.

## See Also

### Accessing Porter-Duff modes

- [clear](swiftui/graphicscontext/blendmode-swift.struct/clear.md)
- [copy](swiftui/graphicscontext/blendmode-swift.struct/copy.md)
- [sourceIn](swiftui/graphicscontext/blendmode-swift.struct/sourcein.md)
- [sourceOut](swiftui/graphicscontext/blendmode-swift.struct/sourceout.md)
- [sourceAtop](swiftui/graphicscontext/blendmode-swift.struct/sourceatop.md)
- [destinationOver](swiftui/graphicscontext/blendmode-swift.struct/destinationover.md)
- [destinationIn](swiftui/graphicscontext/blendmode-swift.struct/destinationin.md)
- [destinationOut](swiftui/graphicscontext/blendmode-swift.struct/destinationout.md)
- [destinationAtop](swiftui/graphicscontext/blendmode-swift.struct/destinationatop.md)
