# BrushPaint.TextureLayer.BlendMode

Artifact: [androidx.ink:ink-brush](https://developer.android.com/jetpack/androidx/releases/ink) [View Source](https://cs.android.com/search?q=file:androidx/ink/brush/BrushPaint.kt+class:androidx.ink.brush.BrushPaint.TextureLayer.BlendMode) Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOS
- Cmn

  ```
  class BrushPaint.TextureLayer.BlendMode
  ```

*** ** * ** ***

The method by which the combined texture layers (index \<= i) are blended with the next layer. The blend mode on the final layer controls how the combined texture is blended with the brush color, and should typically be a mode whose output alpha is proportional to the destination alpha, so that it can be adjusted by anti-aliasing.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#DST()` Keeps the destination pixels and discards the source pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#DST_ATOP()` Discards destination pixels that aren't covered by source pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#DST_IN()` Keeps destination pixels that cover source pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#DST_OUT()` Keeps the destination pixels not covered by source pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#DST_OVER()` The source pixels are drawn behind the destination pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#MODULATE()` Source and destination are component-wise multiplied, including opacity. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#SRC()` Keeps the source pixels and discards the destination pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#SRC_ATOP()` Discards source pixels that do not cover destination pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#SRC_IN()` Keeps the source pixels that cover destination pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#SRC_OUT()` Keeps the source pixels that do not cover destination pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#SRC_OVER()` The source pixels are drawn over the destination pixels. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#XOR()` Discards source and destination pixels that intersect; keeps source and destination pixels that do not intersect. | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#calculateMinimumRequiredVersion()()` Returns the minimum required `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode`. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode#toString()()` | Cmn |

## Public companion properties

### DST

Cmn

```
val DST: BrushPaint.TextureLayer.BlendMode
```

Keeps the destination pixels and discards the source pixels.

```kotlin
Alpha = Alpha_dst
Color = Color_dst
```

This mode is unlikely to be useful, since it effectively causes the renderer to just ignore this `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer` and all layers before it, but it is included for completeness.

### DST_ATOP

Cmn

```
val DST_ATOP: BrushPaint.TextureLayer.BlendMode
```

Discards destination pixels that aren't covered by source pixels. Remaining destination pixels are drawn over source pixels.

```kotlin
Alpha = Alpha_src
Color = Alpha_src * Color_dst + (1 - Alpha_dst) * Color_src
```

This mode shouldn't normally be used for the final `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer`, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).

### DST_IN

Cmn

```
val DST_IN: BrushPaint.TextureLayer.BlendMode
```

Keeps destination pixels that cover source pixels. Discards remaining source and destination pixels.

```kotlin
Alpha = Alpha_src * Alpha_dst
Color = Alpha_src * Color_dst
```

### DST_OUT

Cmn

```
val DST_OUT: BrushPaint.TextureLayer.BlendMode
```

Keeps the destination pixels not covered by source pixels. Discards destination pixels that are covered by source pixels and all source pixels.

```kotlin
Alpha = (1 - Alpha_src) * Alpha_dst
Color = (1 - Alpha_src) * Color_dst
```

### DST_OVER

Cmn

```
val DST_OVER: BrushPaint.TextureLayer.BlendMode
```

The source pixels are drawn behind the destination pixels.

```kotlin
Alpha = Alpha_dst + (1 - Alpha_dst) * Alpha_src
Color = Color_dst + (1 - Alpha_dst) * Color_src
```

This mode shouldn't normally be used for the final `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer`, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).

### MODULATE

Cmn

```
val MODULATE: BrushPaint.TextureLayer.BlendMode
```

Source and destination are component-wise multiplied, including opacity.

```kotlin
Alpha = Alpha_src * Alpha_dst
Color = Color_src * Color_dst
```

### SRC

Cmn

```
val SRC: BrushPaint.TextureLayer.BlendMode
```

Keeps the source pixels and discards the destination pixels.

```kotlin
Alpha = Alpha_src
Color = Color_src
```

This mode shouldn't normally be used for the final `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer`, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).

### SRC_ATOP

Cmn

```
val SRC_ATOP: BrushPaint.TextureLayer.BlendMode
```

Discards source pixels that do not cover destination pixels. Draws remaining pixels over destination pixels.

```kotlin
Alpha = Alpha_dst
Color = Alpha_dst * Color_src + (1 - Alpha_src) * Color_dst
```

### SRC_IN

Cmn

```
val SRC_IN: BrushPaint.TextureLayer.BlendMode
```

Keeps the source pixels that cover destination pixels. Discards remaining source and destination pixels.

```kotlin
Alpha = Alpha_src * Alpha_dst
Color = Color_src * Alpha_dst
```

### SRC_OUT

Cmn

```
val SRC_OUT: BrushPaint.TextureLayer.BlendMode
```

Keeps the source pixels that do not cover destination pixels. Discards destination pixels and all source pixels that cover destination pixels.

```kotlin
Alpha = (1 - Alpha_dst) * Alpha_src
Color = (1 - Alpha_dst) * Color_src
```

This mode shouldn't normally be used for the final `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer`, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).

### SRC_OVER

Cmn

```
val SRC_OVER: BrushPaint.TextureLayer.BlendMode
```

The source pixels are drawn over the destination pixels.

```kotlin
Alpha = Alpha_src + (1 - Alpha_src) * Alpha_dst
Color = Color_src + (1 - Alpha_src) * Color_dst
```

This mode shouldn't normally be used for the final `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer`, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).

### XOR

Cmn

```
val XOR: BrushPaint.TextureLayer.BlendMode
```

Discards source and destination pixels that intersect; keeps source and destination pixels that do not intersect.

```kotlin
Alpha = (1 - Alpha_dst) * Alpha_src + (1 - Alpha_src) * Alpha_dst
Color = (1 - Alpha_dst) * Color_src + (1 - Alpha_src) * Color_dst
```

This mode shouldn't normally be used for the final `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer`, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).

## Public functions

### calculateMinimumRequiredVersion

Cmn Added in [1.1.0-alpha11](https://developer.android.com/jetpack/androidx/releases/ink#1.1.0-alpha11)

```
fun calculateMinimumRequiredVersion(): Version
```

Returns the minimum required `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` for this `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode`.

By default, decoding a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushFamily` containing a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` with a minimum required version higher than `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version#MAX_SUPPORTED()` will fail.

### toString

Cmn

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