# BrushPainter

Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/painter/BrushPainter.kt+class:androidx.compose.ui.graphics.painter.BrushPainter) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.1.0) Common/All
- Cmn

  ```
  class BrushPainter : Painter
  ```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.compose.ui.graphics.painter.Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter) ||
|   | ↳ | [androidx.compose.ui.graphics.painter.BrushPainter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BrushPainter) |

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` implementation used to fill the provided bounds with the specified `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush`. The intrinsic size of this `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` is determined by `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush#intrinsicSize()`

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BrushPainter#BrushPainter(androidx.compose.ui.graphics.Brush)(brush: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush)` | Cmn |

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

| ### Protected functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BrushPainter#applyAlpha(kotlin.Float)(alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BrushPainter#applyColorFilter(androidx.compose.ui.graphics.ColorFilter)(colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?)` Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BrushPainter#(androidx.compose.ui.graphics.drawscope.DrawScope).onDraw()()` Implementation of drawing logic for instances of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BrushPainter#brush()` | Cmn |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/BrushPainter#intrinsicSize()` Return the intrinsic size of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. | Cmn |

| ### Inherited functions |
|---|
| From [androidx.compose.ui.graphics.painter.Painter](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter) |---|---|---| | `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter#applyLayoutDirection(androidx.compose.ui.unit.LayoutDirection)(layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection)` Apply the appropriate internal configuration to positioning content with the given `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | Cmn | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/drawscope/DrawScope.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter#(androidx.compose.ui.graphics.drawscope.DrawScope).draw(androidx.compose.ui.geometry.Size,kotlin.Float,androidx.compose.ui.graphics.ColorFilter)(size: https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size, alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, colorFilter: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?)` | Cmn | |

## Public constructors

### BrushPainter

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

```
BrushPainter(brush: Brush)
```

## Public functions

### equals

Cmn

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

### hashCode

Cmn

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

### toString

Cmn

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

## Protected functions

### applyAlpha

Cmn

```
protected open fun applyAlpha(alpha: Float): Boolean
```

Apply the provided alpha value returning true if it was applied successfully, or false if it could not be applied

### applyColorFilter

Cmn

```
protected open fun applyColorFilter(colorFilter: ColorFilter?): Boolean
```

Apply the provided color filter returning true if it was applied successfully, or false if it could not be applied

### DrawScope.onDraw

Cmn Artifact: [androidx.compose.ui:ui-graphics](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/graphics/painter/BrushPainter.kt+function:onDraw)

```
protected open fun DrawScope.onDraw(): Unit
```

Implementation of drawing logic for instances of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. This is invoked internally within `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter#(androidx.compose.ui.graphics.drawscope.DrawScope).draw(androidx.compose.ui.geometry.Size,kotlin.Float,androidx.compose.ui.graphics.ColorFilter)` after the positioning and configuring the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`

## Public properties

### brush

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

```
val brush: Brush
```

### intrinsicSize

Cmn

```
open val intrinsicSize: Size
```

Return the intrinsic size of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter`. If the there is no intrinsic size (i.e. filling bounds with an arbitrary color) return `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size#Unspecified()`. If there is no intrinsic size in a single dimension, return `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` with `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/-companion/-na-n.html` in the desired dimension. If a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/painter/Painter` does not have an intrinsic size, it will always draw within the full bounds of the destination