WearWidgetBrush

sealed class WearWidgetBrush

Known direct subclasses
WearWidgetBrush.Companion

The WearWidgetBrush companion object is the empty, default, or starter WearWidgetBrush that contains no elements.


Defines a brush for a Wear Widget surface.

This class acts similar to androidx.compose.remote.creation.compose.shaders.RemoteBrush but it restricts the available options to ensure compatibility with surfaces that support a limited feature set, such as WearWidgetDocument.background.

Summary

Nested types

The WearWidgetBrush companion object is the empty, default, or starter WearWidgetBrush that contains no elements.

Protected constructors

Extension functions

WearWidgetBrush

Creates a WearWidgetBrush with a solid color.

WearWidgetBrush

Creates a WearWidgetBrush with a horizontal gradient and the given colors evenly dispersed within the gradient.

WearWidgetBrush

Creates a WearWidgetBrush with a vertical gradient and the given colors evenly dispersed within the gradient.

Protected constructors

WearWidgetBrush

protected WearWidgetBrush()

Extension functions

WearWidgetBrush.color

fun WearWidgetBrush.color(color: RemoteColor): WearWidgetBrush

Creates a WearWidgetBrush with a solid color.

Parameters
color: RemoteColor

The RemoteColor to use for the brush.

WearWidgetBrush.horizontalGradient

fun WearWidgetBrush.horizontalGradient(colors: List<RemoteColor>): WearWidgetBrush

Creates a WearWidgetBrush with a horizontal gradient and the given colors evenly dispersed within the gradient.

Because the gradient is drawn across the entire surface, tiling is not required. Therefore, TileMode defaults to TileMode.Clamp.

Example:

WearWidgetBrush.horizontalGradient(listOf(Color.Red.rc, Color.Green.rc, Color.Blue.rc))
Parameters
colors: List<RemoteColor>

The list of RemoteColors to be rendered as part of the gradient

WearWidgetBrush.verticalGradient

fun WearWidgetBrush.verticalGradient(colors: List<RemoteColor>): WearWidgetBrush

Creates a WearWidgetBrush with a vertical gradient and the given colors evenly dispersed within the gradient.

Because the gradient is drawn across the entire surface, tiling is not required. Therefore, TileMode defaults to TileMode.Clamp.

Example:

WearWidgetBrush.verticalGradient(listOf(Color.Red.rc, Color.Green.rc, Color.Blue.rc))
Parameters
colors: List<RemoteColor>

The list of RemoteColors to be rendered as part of the gradient