# ForegroundScope

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/StyleScope.kt+class:androidx.compose.foundation.style.ForegroundScope) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.12.0) Common/All
- Cmn

  ```
  @ExperimentalFoundationStyleApi
  interface ForegroundScope
  ```
Known direct subclasses [DrawStyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/DrawStyleScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/DrawStyleScope` | An interface that introduces the drawing property to a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` receiver scope. |

Known indirect subclasses [StyleScope](https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` | A `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` is the receiver scope of a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` lambda. |

*** ** * ** ***

An interface that introduces the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ForegroundScope#foreground(androidx.compose.ui.graphics.Color)` property to a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/Style` receiver scope.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/StyleScope` |   |

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ForegroundScope#foreground(androidx.compose.ui.graphics.Brush)(value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush)` Sets the foreground brush for the component. | Cmn |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ForegroundScope#foreground(androidx.compose.ui.graphics.Color)(value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color)` Sets the foreground color for the component. | Cmn |

## Public functions

### foreground

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

```
fun foreground(value: Brush): Unit
```

Sets the foreground brush for the component. This can be used to overlay a color or gradient on top of the component's content. It is important that this brush be partially transparent (e.g. alpha less than 1.0) or it will obscure the content. If a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ShapeScope#shape(androidx.compose.ui.graphics.Shape)` is applied, the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ForegroundScope#foreground(androidx.compose.ui.graphics.Brush)` will fill that shape.

This property is *not* inherited

| Parameters |
|---|---|
| `value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Brush` | The brush to use for the foreground. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ContentColorScope#contentColor(androidx.compose.ui.graphics.Color)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ContentColorScope#contentBrush(androidx.compose.ui.graphics.Brush)` |   |

### foreground

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

```
fun foreground(value: Color): Unit
```

Sets the foreground color for the component. This can be used to overlay a color on top of the component's content. It is important that this brush be partially transparent (e.g. alpha less than 1.0) or it will obscure the content. If a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ShapeScope#shape(androidx.compose.ui.graphics.Shape)` is applied, the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ForegroundScope#foreground(androidx.compose.ui.graphics.Color)` will fill that shape.

This property is *not* inherited

| Parameters |
|---|---|
| `value: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | The brush to use for the foreground. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ContentColorScope#contentColor(androidx.compose.ui.graphics.Color)` |   |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/style/ContentColorScope#contentBrush(androidx.compose.ui.graphics.Brush)` |   |