# RippleAlpha

Artifact: [androidx.compose.material:material-ripple](https://developer.android.com/jetpack/androidx/releases/compose-material) [View Source](https://cs.android.com/search?q=file:androidx/compose/material/ripple/RippleTheme.kt+class:androidx.compose.material.ripple.RippleAlpha) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0) Common/All
- Cmn

  ```
  class RippleAlpha
  ```

*** ** * ** ***

RippleAlpha defines the alpha of the ripple / state layer for different `https://developer.android.com/reference/kotlin/androidx/compose/foundation/interaction/Interaction`s.

On Android, because the press ripple is drawn using the framework's RippleDrawable, there are constraints / different behaviours for the actual press alpha used on different API versions. Note that this *only* affects `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#pressedAlpha()` - the other values are guaranteed to be consistent, as they do not rely on framework code. Specifically:

API 21-27: The actual ripple is split into two 'layers', with the alpha applied to both layers, so there is no uniform 'alpha'. API 28-32: The ripple is just one layer, but the alpha is clamped to a maximum of 0.5f - it is not possible to have a fully opaque ripple. API 33: There is a bug where the ripple is clamped to a *minimum* of 0.5, instead of a maximum like before - this should be resolved in future versions.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#RippleAlpha(kotlin.Float,kotlin.Float,kotlin.Float,kotlin.Float)( draggedAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, focusedAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, hoveredAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, pressedAlpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` | Cmn |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#draggedAlpha()` the alpha used when the ripple is dragged | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#focusedAlpha()` the alpha used when the ripple is focused | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#hoveredAlpha()` the alpha used when the ripple is hovered | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material/ripple/RippleAlpha#pressedAlpha()` the alpha used when the ripple is pressed | Cmn |

## Public constructors

### RippleAlpha

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
RippleAlpha(
    draggedAlpha: Float,
    focusedAlpha: Float,
    hoveredAlpha: Float,
    pressedAlpha: Float
)
```

## Public functions

### equals

Cmn

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

Cmn

```
open fun hashCode(): Int
```

### toString

Cmn

```
open fun toString(): String
```

## Public properties

### draggedAlpha

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
val draggedAlpha: Float
```

the alpha used when the ripple is dragged

### focusedAlpha

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
val focusedAlpha: Float
```

the alpha used when the ripple is focused

### hoveredAlpha

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
val hoveredAlpha: Float
```

the alpha used when the ripple is hovered

### pressedAlpha

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)

```
val pressedAlpha: Float
```

the alpha used when the ripple is pressed