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

BackgroundScope

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

Source set: Common
@ExperimentalFoundationStyleApi
interface BackgroundScope

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

Functions

background

fun background(color: Color)

Sets the background color of the component. If a ShapeScope.shape is applied, the background will fill that shape.

Setting a background color will override any previously set background brush.

This property is not inherited

Parameters

color The background color.

background

fun background(value: Brush)

Sets the background of the component using a Brush. This allows for gradient backgrounds or other complex fills. If a ShapeScope.shape is applied, the background will fill that shape.

Setting a background brush will override any previously set background color.

This property is not inherited

Parameters

value The brush to use for the background.

Last updated: