# Paint

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

  ```
  interface Paint
  ```
Known direct subclasses [AndroidPaint](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/AndroidPaint` | 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 functions |
|---|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/NativePaint` | `[asFrameworkPaint](https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#asFrameworkPaint())()` **This function is deprecated.** Use platform-specific extension to get platform reference | Cmn |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#alpha()` Configures the alpha value between 0f to 1f representing fully transparent to fully opaque for the color drawn with this Paint | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/BlendMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#blendMode()` A blend mode to apply when a shape is drawn or a layer is composited. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#color()` The color to use when stroking or filling a shape. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/ColorFilter?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#colorFilter()` A color filter to apply when a shape is drawn or when a layer is composited. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/FilterQuality` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#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()`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#isAntiAlias()` Whether to apply anti-aliasing to lines and images drawn on the canvas. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathEffect?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#pathEffect()` Specifies the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PathEffect` applied to the geometry of the shape that is drawn | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shader?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#shader()` The shader to use when stroking or filling a shape. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeCap` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#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()`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/StrokeJoin` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#strokeJoin()` The kind of finish to place on the joins between segments. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#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()`. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#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()`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/PaintingStyle` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#style()` Whether to paint inside shapes, the edges of shapes, or both. | Cmn |

| ### Extension properties |
|---|---|---|
| `https://developer.android.com/reference/android/graphics/Paint.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint#(androidx.compose.ui.graphics.Paint).nativePaint()` Convert a Compose `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint` instance into an `https://developer.android.com/reference/android/graphics/Paint.html`. | android |

## Public functions

### asFrameworkPaint

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

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

> [!CAUTION]
> **This function is deprecated.**   
> Use platform-specific extension to get platform reference

## Public properties

### alpha

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

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

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

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

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

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

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

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

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

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

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

```
var isAntiAlias: Boolean
```

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

### pathEffect

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

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

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

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

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

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

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

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

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

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

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

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

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

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

## Extension properties

### Paint.nativePaint

android 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+symbol:nativePaint)

```
val Paint.nativePaint: Paint
```

Convert a Compose `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Paint` instance into an `https://developer.android.com/reference/android/graphics/Paint.html`.