---
title: "opacity(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/hovereffectcontent/opacity(_:)"
---

# opacity(_:)

Sets the transparency of the view.

## Declaration

```swift
func opacity(_ opacity: Double) -> some HoverEffectContent

```

## Parameters

- `opacity`: A value between 0 (fully transparent) and 1 (fully opaque).

## Return Value

Return Value An effect that sets the transparency of the view.

## Discussion

Discussion When applying the opacity(_:) effect to a view that has already had its opacity transformed, the effect of the underlying opacity transformation is multiplied.
