# BrushPaint

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) 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
  ```

*** ** * ** ***

Parameters that control stroke mesh rendering.

The core of each paint consists of one or more texture layers. The output of each layer is blended together in sequence, then the combined texture is blended with the output from the brush color.

- Starting with the first `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer`, the combined texture for layers 0 to i (source) is blended with layer i+1 (destination) using the blend mode for layer i.

- The final combined texture (source) is blended with the (possibly adjusted per-vertex) brush color (destination) according to the blend mode of the last texture layer.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.AnimationRepeatMode` Specifies what should happen when a brush paint animation repeats. |
| `abstract class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction` A `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction` defines a mapping over colors. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction.OpacityMultiplier : https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction` A `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction` that scales the color opacity by a specified multiplier. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction.ReplaceColor : https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction` A `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction` that ignores the input color and replaces it with the specified color. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.StampingTexture : https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer` A texture that is "stamped" onto each particle of the stroke, scaled or rotated appropriately to cover the whole particle. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.StampingTexture.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.StampingTexture`. |
| `abstract class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer` |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.BlendMode` The method by which the combined texture layers (index \<= i) are blended with the next layer. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.SizeUnit` Units for specifying `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer` dimensions. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer.Wrap` Wrap modes for specifying `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer` wrapping behavior. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TilingTexture : https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer` A texture layer that will repeat according to a 2D affine transformation of vertex positions. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TilingTexture.Builder` Builder for `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TilingTexture`. |
| `class https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TilingTexture.Origin` Specification of the origin point to use for the texture. |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#BrushPaint(kotlin.collections.List,kotlin.collections.List,androidx.ink.brush.SelfOverlap)( textureLayers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer>, colorFunctions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction>, selfOverlap: https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap )` Creates a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint` with the given `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#(kotlin.collections.List,kotlin.collections.List,androidx.ink.brush.SelfOverlap)`. | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#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`. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#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/ink/brush/BrushPaint#hashCode()()` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#toString()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction>` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#colorFunctions()` An immutable list of the transformations to apply to the base brush color (in order) before drawing this coat of paint. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#paintAnimationLoopDurationMillis()` Returns the duration of a complete paint animation loop for this brush paint (such that the paint goes through one complete loop and returns to its starting point), or zero if this brush paint is not animated. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#selfOverlap()` | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer>` | `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#textureLayers()` An immutable list of the textures to apply to the stroke. | Cmn |

## Public constructors

### BrushPaint

Cmn

```
BrushPaint(
    textureLayers: List<BrushPaint.TextureLayer> = emptyList(),
    colorFunctions: List<BrushPaint.ColorFunction> = emptyList(),
    selfOverlap: SelfOverlap = SelfOverlap.ANY
)
```

Creates a `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint` with the given `https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint#(kotlin.collections.List,kotlin.collections.List,androidx.ink.brush.SelfOverlap)`.

| Parameters |
|---|---|
| `textureLayers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.TextureLayer> = emptyList()` | The textures to apply to the stroke. |
| `colorFunctions: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/ink/brush/BrushPaint.ColorFunction> = emptyList()` | The color functions to apply to the brush color. |
| `selfOverlap: https://developer.android.com/reference/kotlin/androidx/ink/brush/SelfOverlap = SelfOverlap.ANY` | The self-overlap behavior to apply to this coat of the stroke. |

## 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`.

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` with a minimum required version higher than `https://developer.android.com/reference/kotlin/androidx/ink/brush/Version#MAX_SUPPORTED()` will fail.

### equals

Cmn

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

### hashCode

Cmn

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

### toString

Cmn

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

## Public properties

### colorFunctions

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

```
val colorFunctions: List<BrushPaint.ColorFunction>
```

An immutable list of the transformations to apply to the base brush color (in order) before drawing this coat of paint. When this list is empty, the base brush color will be used unchanged.

### paintAnimationLoopDurationMillis

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

```
val paintAnimationLoopDurationMillis: Long
```

Returns the duration of a complete paint animation loop for this brush paint (such that the paint goes through one complete loop and returns to its starting point), or zero if this brush paint is not animated. If nonzero, this duration will be no greater than 2\^24 milliseconds (about 4.66 hours).

### selfOverlap

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

```
val selfOverlap: SelfOverlap
```

### textureLayers

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

```
val textureLayers: List<BrushPaint.TextureLayer>
```

An immutable list of the textures to apply to the stroke.