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

# opacity(_:)

Multiplies the opacity of the color by the given amount.

## Declaration

```swift
func opacity(_ opacity: Double) -> Color
```

## Parameters

- `opacity`: The amount by which to multiply the opacity of the color.

## Return Value

Return Value A view with modified opacity.

## See Also

### Modifying a color

- [gradient](swiftui/color/gradient.md)
- [mix(with:by:in:)](swiftui/color/mix(with:by:in:).md)
- [exposureAdjust(_:)](swiftui/color/exposureadjust(_:).md)
- [headroom(_:)](swiftui/color/headroom(_:).md)
