Interface

BackgroundScope

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

Source set: Common
@Deprecated(
    DeprecatedStyleScope,
    replaceWith = ReplaceWith(""),
    level = DeprecationLevel.WARNING,
)
public interface BackgroundScope

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

Functions

background

Source set: Common
public 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

Source set: Common
public 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.
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: