# AndroidPaint

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/AndroidPaint.android.kt+class:androidx.compose.ui.graphics.AndroidPaint) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.0.0) Common/AllAndroid/JVM
- android

  ```
  class AndroidPaint : Paint
  ```

*** ** * ** ***

Create a Compose `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint` instance backed by an `https://developer.android.com/reference/android/graphics/Paint.html` object to be consumed by Compose applications running on the Android platform

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#AndroidPaint()()` Create a new `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint` instance backed by a newly created `https://developer.android.com/reference/android/graphics/Paint.html` | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#AndroidPaint(android.graphics.Paint)(internalPaint: https://developer.android.com/reference/android/graphics/Paint.html)` | android |

| ### Public functions |
|---|---|---|
| `open https://developer.android.com/reference/android/graphics/Paint.html` | `[asFrameworkPaint](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#asFrameworkPaint())()` **This function is deprecated.** Use \[nativePaint\] extension instead | android |

| ### Public properties |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#alpha()` Configures the alpha value between 0f to 1f representing fully transparent to fully opaque for the color drawn with this Paint | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#blendMode()` A blend mode to apply when a shape is drawn or a layer is composited. | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#color()` The color to use when stroking or filling a shape. | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#colorFilter()` A color filter to apply when a shape is drawn or when a layer is composited. | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#filterQuality()` Controls the performance vs quality trade-off to use when applying when drawing images, as with `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#drawImageRect(androidx.compose.ui.graphics.ImageBitmap,androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntSize,androidx.compose.ui.graphics.Paint)` Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality#Low()`. | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#isAntiAlias()` Whether to apply anti-aliasing to lines and images drawn on the canvas. | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathEffect?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#pathEffect()` Specifies the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathEffect` applied to the geometry of the shape that is drawn | android |
| `open https://developer.android.com/reference/android/graphics/Shader.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#shader()` The shader to use when stroking or filling a shape. | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeCap` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#strokeCap()` The kind of finish to place on the end of lines drawn when `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Stroke()`. | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeJoin` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#strokeJoin()` The kind of finish to place on the joins between segments. | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#strokeMiterLimit()` The limit for miters to be drawn on segments when the join is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeJoin#Miter()` and the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Stroke()`. | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#strokeWidth()` How wide to make edges drawn when `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Stroke()`. | android |
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#style()` Whether to paint inside shapes, the edges of shapes, or both. | android |

## Public constructors

### AndroidPaint

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

```
AndroidPaint()
```

Create a new `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint` instance backed by a newly created `https://developer.android.com/reference/android/graphics/Paint.html`

### AndroidPaint

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

```
AndroidPaint(internalPaint: Paint)
```

| Parameters |
|---|---|
| `internalPaint: https://developer.android.com/reference/android/graphics/Paint.html` | `https://developer.android.com/reference/android/graphics/Paint.html` to be wrapped by the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint` instance |

## Public functions

### asFrameworkPaint

android

```
open fun [asFrameworkPaint](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint#asFrameworkPaint())(): Paint
```

> [!CAUTION]
> **This function is deprecated.**   
> Use \[nativePaint\] extension instead, use this instead:
>
> ```kotlin
> nativePaint
> ```

## Public properties

### alpha

android

```
open var alpha: Float
```

Configures the alpha value between 0f to 1f representing fully transparent to fully opaque for the color drawn with this Paint

### blendMode

android

```
open var blendMode: BlendMode
```

A blend mode to apply when a shape is drawn or a layer is composited. The source colors are from the shape being drawn (e.g. from `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#drawPath(androidx.compose.ui.graphics.Path,androidx.compose.ui.graphics.Paint)`) or layer being composited (the graphics that were drawn between the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#saveLayer(androidx.compose.ui.geometry.Rect,androidx.compose.ui.graphics.Paint)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#restore()` calls), after applying the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#colorFilter()`, if any. The destination colors are from the background onto which the shape or layer is being composited. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode#SrcOver()`. See also: `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#saveLayer(androidx.compose.ui.geometry.Rect,androidx.compose.ui.graphics.Paint)`, which uses its `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint`'s `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#blendMode()` to composite the layer when `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#restore()` is called. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode`, which discusses the user of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#saveLayer(androidx.compose.ui.geometry.Rect,androidx.compose.ui.graphics.Paint)` with `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#blendMode()`.

### color

android

```
open var color: Color
```

The color to use when stroking or filling a shape. Defaults to opaque black. See also: `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()`, which controls whether to stroke or fill (or both). `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#colorFilter()`, which overrides `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#color()`. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#shader()`, which overrides `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#color()` with more elaborate effects. This color is not used when compositing. To colorize a layer, use `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#colorFilter()`.

### colorFilter

android

```
open var colorFilter: ColorFilter?
```

A color filter to apply when a shape is drawn or when a layer is composited. See `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter` for details. When a shape is being drawn, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#colorFilter()` overrides `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#color()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#shader()`.

### filterQuality

android

```
open var filterQuality: FilterQuality
```

Controls the performance vs quality trade-off to use when applying when drawing images, as with `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#drawImageRect(androidx.compose.ui.graphics.ImageBitmap,androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntSize,androidx.compose.ui.unit.IntOffset,androidx.compose.ui.unit.IntSize,androidx.compose.ui.graphics.Paint)` Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality#Low()`.

### isAntiAlias

android

```
open var isAntiAlias: Boolean
```

Whether to apply anti-aliasing to lines and images drawn on the canvas. Defaults to true.

### pathEffect

android

```
open var pathEffect: PathEffect?
```

Specifies the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathEffect` applied to the geometry of the shape that is drawn

### shader

android

```
open var shader: Shader?
```

The shader to use when stroking or filling a shape.

When this is null, the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#color()` is used instead.

See also: `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#LinearGradientShader(androidx.compose.ui.geometry.Offset,androidx.compose.ui.geometry.Offset,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.graphics.TileMode)`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#RadialGradientShader(androidx.compose.ui.geometry.Offset,kotlin.Float,kotlin.collections.List,kotlin.collections.List,androidx.compose.ui.graphics.TileMode)`, or `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#SweepGradientShader(androidx.compose.ui.geometry.Offset,kotlin.collections.List,kotlin.collections.List)` shaders that paint a color gradient. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/package-summary#ImageShader(androidx.compose.ui.graphics.ImageBitmap,androidx.compose.ui.graphics.TileMode,androidx.compose.ui.graphics.TileMode)`, a shader that tiles an `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ImageBitmap`. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#colorFilter()`, which overrides `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#shader()`. `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#color()`, which is used if `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#shader()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#colorFilter()` are null.

### strokeCap

android

```
open var strokeCap: StrokeCap
```

The kind of finish to place on the end of lines drawn when `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Stroke()`. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeCap#Butt()`, i.e. no caps.

### strokeJoin

android

```
open var strokeJoin: StrokeJoin
```

The kind of finish to place on the joins between segments. This applies to paths drawn when `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Stroke()`, It does not apply to points drawn as lines with `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Canvas#drawPoints(androidx.compose.ui.graphics.PointMode,kotlin.collections.List,androidx.compose.ui.graphics.Paint)`. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeJoin#Miter()`, i.e. sharp corners. See also `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#strokeMiterLimit()` to control when miters are replaced by bevels.

### strokeMiterLimit

android

```
open var strokeMiterLimit: Float
```

The limit for miters to be drawn on segments when the join is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeJoin#Miter()` and the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Stroke()`. If this limit is exceeded, then a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeJoin#Bevel()` join will be drawn instead. This may cause some 'popping' of the corners of a path if the angle between line segments is animated. This limit is expressed as a limit on the length of the miter. Defaults to 4.0. Using zero as a limit will cause a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeJoin#Bevel()` join to be used all the time.

### strokeWidth

android

```
open var strokeWidth: Float
```

How wide to make edges drawn when `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` is set to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Stroke()`. The width is given in logical pixels measured in the direction orthogonal to the direction of the path. Defaults to 0.0, which correspond to a hairline width.

### style

android

```
open var style: PaintingStyle
```

Whether to paint inside shapes, the edges of shapes, or both. Defaults to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle#Fill()`.