<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/VisualEffect",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI12VisualEffectP"
  },
  "title" : "VisualEffect"
}
-->

# VisualEffect

Visual Effects change the visual appearance of a view without changing its
ancestors or descendents.

```
protocol VisualEffect : Sendable, Animatable
```

## Overview

Because effects do not impact layout, they are safe to use in situations
where layout modification is not allowed. For example, effects may be
applied as a function of position, accessed through a geometry proxy:

```swift
var body: some View {
    ContentRow()
        .visualEffect { content, geometryProxy in
            content.offset(x: geometryProxy.frame(in: .global).origin.y)
        }
}
```

You don’t conform to this protocol yourself. Instead, visual effects are
created by calling modifier functions (such as `.offset(x:y:)` on other
effects, as seen in the example above.

## Topics

### Adjusting Color

[`brightness(_:)`](/documentation/SwiftUI/VisualEffect/brightness(_:))

Brightens the view by the specified amount.

[`colorEffect(_:isEnabled:)`](/documentation/SwiftUI/VisualEffect/colorEffect(_:isEnabled:))

Returns a new visual effect that applies `shader` to `self` as
a filter effect on the color of each pixel.

[`contrast(_:)`](/documentation/SwiftUI/VisualEffect/contrast(_:))

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

[`grayscale(_:)`](/documentation/SwiftUI/VisualEffect/grayscale(_:))

Adds a grayscale effect to the view.

[`hueRotation(_:)`](/documentation/SwiftUI/VisualEffect/hueRotation(_:))

Applies a hue rotation effect to the view.

[`saturation(_:)`](/documentation/SwiftUI/VisualEffect/saturation(_:))

Adjusts the color saturation of the view.

[`opacity(_:)`](/documentation/SwiftUI/VisualEffect/opacity(_:))

Sets the transparency of the view.

### Scaling

[`scaleEffect(_:anchor:)`](/documentation/SwiftUI/VisualEffect/scaleEffect(_:anchor:))

Scales this view uniformly by the specified factor,
relative to an anchor point.

[`scaleEffect(x:y:anchor:)`](/documentation/SwiftUI/VisualEffect/scaleEffect(x:y:anchor:))

Scales the view’s rendered output by the given horizontal and vertical
amounts, relative to an anchor point.

[`scaleEffect(x:y:z:anchor:)`](/documentation/SwiftUI/VisualEffect/scaleEffect(x:y:z:anchor:))

Scales this view by the specified horizontal, vertical, and depth
factors, relative to an anchor point.

### Rotating

[`rotationEffect(_:anchor:)`](/documentation/SwiftUI/VisualEffect/rotationEffect(_:anchor:))

Rotates content in two dimensions around the specified point.

[`rotation3DEffect(_:axis:anchor:anchorZ:perspective:)`](/documentation/SwiftUI/VisualEffect/rotation3DEffect(_:axis:anchor:anchorZ:perspective:))

Renders content as if it’s rotated in three dimensions around
the specified axis.

[`perspectiveRotationEffect(_:axis:anchor:perspective:)`](/documentation/SwiftUI/VisualEffect/perspectiveRotationEffect(_:axis:anchor:perspective:))

Renders content as if it’s rotated in three dimensions around
the specified axis.

[`rotation3DEffect(_:anchor:)`](/documentation/SwiftUI/VisualEffect/rotation3DEffect(_:anchor:))

Rotates content by the specified 3D rotation value.

[`rotation3DEffect(_:axis:anchor:)`](/documentation/SwiftUI/VisualEffect/rotation3DEffect(_:axis:anchor:))

Rotates content by an angle about an axis that you specify
as a rotation axis value.

### Translating

[`offset(_:)`](/documentation/SwiftUI/VisualEffect/offset(_:))

Offsets the view by the horizontal and vertical amount specified in the
offset parameter.

[`offset(x:y:)`](/documentation/SwiftUI/VisualEffect/offset(x:y:))

Offsets the view by the specified horizontal and vertical distances.

[`offset(z:)`](/documentation/SwiftUI/VisualEffect/offset(z:))

Brings a view forward in Z by the provided distance in points.

### Applying a transform

[`transform3DEffect(_:)`](/documentation/SwiftUI/VisualEffect/transform3DEffect(_:))

Applies a 3D transformation to this view’s rendered output.

[`transformEffect(_:)`](/documentation/SwiftUI/VisualEffect/transformEffect(_:))

Applies an affine transformation to the view’s rendered output.

### Applying other effects

[`blur(radius:opaque:)`](/documentation/SwiftUI/VisualEffect/blur(radius:opaque:))

Applies a Gaussian blur to the view.

[`distortionEffect(_:maxSampleOffset:isEnabled:)`](/documentation/SwiftUI/VisualEffect/distortionEffect(_:maxSampleOffset:isEnabled:))

Returns a new visual effect that applies `shader` to `self` as
a geometric distortion effect on the location of each pixel.

[`layerEffect(_:maxSampleOffset:isEnabled:)`](/documentation/SwiftUI/VisualEffect/layerEffect(_:maxSampleOffset:isEnabled:))

Returns a new visual effect that applies `shader` to `self` as
a filter on the raster layer created from `self`.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)