Compose Unstyled 2.0 is out! Check the official announcement blog ->
Interface

ForegroundScope

An interface that introduces the foreground property to a Style receiver scope.

Source set: Common
@ExperimentalFoundationStyleApi
interface ForegroundScope

An interface that introduces the foreground property to a Style receiver scope.

Functions

foreground

fun foreground(value: Color)

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 ShapeScope.shape is applied, the foreground will fill that shape.

This property is not inherited

Parameters

value The brush to use for the foreground.

foreground

fun foreground(value: Brush)

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 ShapeScope.shape is applied, the foreground will fill that shape.

This property is not inherited

Parameters

value The brush to use for the foreground.

Last updated: