---
title: opacity
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/color/resolvedhdr/opacity
---

# opacity

The opacity of the color, in the range 0 to 1.

## Declaration

```swift
var opacity: Float { get set }
```

## Discussion

Discussion A value of 0 means 100% transparency, while a value of 1 means 100% opacity.

## See Also

### Getting color properties

- [red](swiftui/color/resolvedhdr/red.md)
- [green](swiftui/color/resolvedhdr/green.md)
- [blue](swiftui/color/resolvedhdr/blue.md)
- [linearRed](swiftui/color/resolvedhdr/linearred.md)
- [linearGreen](swiftui/color/resolvedhdr/lineargreen.md)
- [linearBlue](swiftui/color/resolvedhdr/linearblue.md)
- [headroom](swiftui/color/resolvedhdr/headroom.md)
