# TileMode

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

  ```
  value class TileMode
  ```

*** ** * ** ***

Defines what happens at the edge of the gradient. A gradient is defined along a finite inner area. In the case of a linear gradient, it's between the parallel lines that are orthogonal to the line drawn between two points. In the case of radial gradients, it's the disc that covers the circle centered on a particular point up to a given radius.

This enum is used to define how the gradient should paint the regions outside that defined inner area.

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)` which works in relative coordinates and can create a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Shader` representing the gradient for a particular `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` on demand.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Clamp()` Edge is clamped to the final color. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Decal()` Render the shader's image pixels only within its original bounds. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Mirror()` Edge is mirrored from last color to first. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Repeated()` Edge is repeated from first color to last. | Cmn |

| ### Public functions |
|---|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#toString()()` | Cmn |

| ### Extension functions |
|---|---|---|
| `https://developer.android.com/reference/android/graphics/Shader.TileMode.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#(androidx.compose.ui.graphics.TileMode).toAndroidTileMode()()` | android |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode.https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#(androidx.compose.ui.graphics.TileMode).isSupported()()` Capability query to determine if the particular platform supports the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode`. | Cmn android |

## Public companion properties

### Clamp

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

```
val Clamp: TileMode
```

Edge is clamped to the final color.

The gradient will paint the all the regions outside the inner area with the color of the point closest to that region. ![TileMode.Clamp](https://developer.android.com/static/images/jetpack/compose/graphics/brush/tile_mode_clamp.png)

### Decal

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

```
val Decal: TileMode
```

Render the shader's image pixels only within its original bounds. If the shader draws outside of its original bounds, transparent black is drawn instead. ![TileMode.Decal](https://developer.android.com/static/images/jetpack/compose/graphics/brush/tile_mode_decal.png)

### Mirror

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

```
val Mirror: TileMode
```

Edge is mirrored from last color to first. This is as if the stop points from 0.0 to 1.0 were then repeated backwards from 2.0 to 1.0, then forwards from 2.0 to 3.0, then backwards again from 4.0 to 3.0, and so forth (and for linear gradients, similarly from in the negative direction). ![TileMode.Mirror](https://developer.android.com/static/images/jetpack/compose/graphics/brush/tile_mode_mirror.png)

### Repeated

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

```
val Repeated: TileMode
```

Edge is repeated from first color to last.

This is as if the stop points from 0.0 to 1.0 were then repeated from 1.0 to 2.0, 2.0 to 3.0, and so forth (and for linear gradients, similarly from -1.0 to 0.0, -2.0 to -1.0, etc). ![TileMode.Repeated](https://developer.android.com/static/images/jetpack/compose/graphics/brush/tile_mode_repeated.png)

## Public functions

### toString

Cmn

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

## Extension functions

### TileMode.toAndroidTileMode

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/AndroidTileMode.android.kt+function:toAndroidTileMode)

```
fun TileMode.toAndroidTileMode(): Shader.TileMode
```

### TileMode.isSupported

Cmn 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/+function:isSupported)

```
fun TileMode.isSupported(): Boolean
```

Capability query to determine if the particular platform supports the `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode`. Not all platforms support all tile mode algorithms, however, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Clamp()`, `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Repeated()` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Mirror()` are guaranteed to be supported. If a `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode` that is not supported is used, the default of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/TileMode#Clamp()` is consumed instead.