# CompositeAlphaMode

Artifact: [androidx.webgpu:webgpu](https://developer.android.com/jetpack/androidx/releases/webgpu) [View Source](https://cs.android.com/search?q=file:androidx/webgpu/CompositeAlphaMode.kt+class:androidx.webgpu.CompositeAlphaMode) Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

*** ** * ** ***


```
class CompositeAlphaMode
```

<br />

*** ** * ** ***

Defines how the alpha channel of a surface's texture is handled during compositing.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CompositeAlphaMode#Auto() = 0` The implementation selects the optimal composite alpha mode. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CompositeAlphaMode#Inherit() = 4` The alpha compositing is handled by the system outside of WebGPU. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CompositeAlphaMode#Opaque() = 1` The alpha channel is ignored and treated as `1.0`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CompositeAlphaMode#Premultiplied() = 2` Color channels are assumed to be premultiplied by the alpha channel. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CompositeAlphaMode#Unpremultiplied() = 3` Color channels are not premultiplied by the alpha channel. |

| ### Public companion functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/webgpu/CompositeAlphaMode#toString(kotlin.Int)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |

## Constants

### Auto

```
const val Auto = 0: Int
```

The implementation selects the optimal composite alpha mode.

### Inherit

```
const val Inherit = 4: Int
```

The alpha compositing is handled by the system outside of WebGPU.

### Opaque

```
const val Opaque = 1: Int
```

The alpha channel is ignored and treated as `1.0`.

### Premultiplied

```
const val Premultiplied = 2: Int
```

Color channels are assumed to be premultiplied by the alpha channel.

### Unpremultiplied

```
const val Unpremultiplied = 3: Int
```

Color channels are not premultiplied by the alpha channel.

## Public companion functions

### toString

Added in [1.0.0-alpha06](https://developer.android.com/jetpack/androidx/releases/webgpu#1.0.0-alpha06)

```
fun toString(value: Int): String
```