---
title: "setAlpha(_:)"
framework: watchkit
role: symbol
role_heading: Instance Method
path: "watchkit/wkinterfaceobject/setalpha(_:)"
---

# setAlpha(_:)

Sets the opacity of the interface object.

## Declaration

```swift
func setAlpha(_ alpha: CGFloat)
```

## Parameters

- `alpha`: A floating-point number in the range 0.0 to 1.0, where 0.0 represents totally transparent and 1.0 represents totally opaque.

## Discussion

Discussion Use this property to make an object fully or partially transparent. A partially transparent object allows the color or background image associated with the containing group or interface controller show through. A fully transparent object cannot be seen but continues to occupy space in your interface. Changes to the alpha value of an object are animatable.

## See Also

### Hiding and Showing an Object

- [setHidden(_:)](watchkit/wkinterfaceobject/sethidden(_:).md)
