---
title: "opacity(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/shapestyle/opacity(_:)-swift.method"
---

# opacity(_:)

Returns a new style based on self that multiplies by the specified opacity when drawing.

## Declaration

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

```

## See Also

### Modifying a shape style

- [blendMode(_:)](swiftui/shapestyle/blendmode(_:)-swift.method.md)
- [shadow(_:)](swiftui/shapestyle/shadow(_:)-swift.method.md)
