# Fill

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/style/StyleProperty.kt+class:androidx.compose.foundation.style.Fill) Added in [1.13.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.13.0-rc01) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  sealed class Fill : Interpolatable
  ```
Known direct subclasses [Fill.Brush](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Brush), [Fill.Color](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Color), [Fill.None](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.None)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Brush` | Fills with a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/GraphicsBrush`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Color` | Fills with a solid `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/GraphicsColor`. |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.None` | Represents an empty fill with no visual representation. |

*** ** * ** ***

Specifies visual fill for styling.

A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` is a value that describes how a region should be filled. "background" or "border color" properties are good candidates for a property of type `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill`.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Brush : https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` Fills with a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/GraphicsBrush`. |
| `class https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Color : https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` Fills with a solid `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/GraphicsColor`. |
| `class https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.None : https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` Represents an empty fill with no visual representation. |

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill#None()` Singleton instance representing no fill. | Cmn |

| ### Protected constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill#Fill()()` | Cmn |

| ### Public functions |
|---|---|---|
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush?` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill#asBrush()()` Return a brush if the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` is a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Brush`, otherwise `null`. | Cmn |
| `abstract https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill#asColor()()` Return the color of this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` if it is a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Color` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Unspecified()` if `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.None` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Brush`. | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill#lerp(kotlin.Any,kotlin.Float)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?, t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` This method is defined such that a value of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)` being 1.0 means that the interpolation has finished, meaning that this method should return either `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)`), 0.0 meaning that the interpolation has not started, returning `this` (or something equivalent to `this`), and values in between meaning that the interpolation is at the relevant point on the timeline between `this` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)`. | Cmn |

## Public companion properties

### None

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

```
val None: Fill
```

Singleton instance representing no fill.

## Protected constructors

### Fill

Cmn

```
protected Fill()
```

## Public functions

### asBrush

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

```
abstract fun asBrush(): Brush?
```

Return a brush if the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` is a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Brush`, otherwise `null`.

### asColor

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

```
abstract fun asColor(): Color
```

Return the color of this `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill` if it is a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Color` or `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Unspecified()` if `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.None` or `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Fill.Brush`.

### lerp

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

```
open fun lerp(other: Any?, t: Float): Any?
```

This method is defined such that a value of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)` being 1.0 means that the interpolation has finished, meaning that this method should return either `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)` (or something equivalent to `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)`), 0.0 meaning that the interpolation has not started, returning `this` (or something equivalent to `this`), and values in between meaning that the interpolation is at the relevant point on the timeline between `this` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)`. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid.

Note that the type of `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)` may not be the same as the type of `this`, however if the implementation knows how to losslessly convert from one type to another, the conversion can be made in order to optimistically provide a valid interpolation.

If `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable#lerp(kotlin.Any,kotlin.Float)` is `null`, this can be interpreted as interpolating between "nothing" or, "no effect", into whatever the value of `this` is. In this case, if it is possible to construct a version of this type that is visually or semantically equivalent to "no effect", then it might make sense to return an interpolation between that value and `this`.

If there is no known way to interpolate between the two values, the implementation should return null.

| Parameters |
|---|---|
| `other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | The other object to be intorpolated with this one. |
| `t: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The position on the timeline. This is usually between 0 and 1, but it is valid for it to be outside of this range. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?` | The interpolated object. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Interpolatable` | #lerp |