Skip to content

Color swatch

ColorSwatch draws the color over a transparency checkerboard, so alpha reads correctly:

A half-transparent red color swatch over a checkerboard

ColorSwatch(
    color = state.color,
    modifier = Modifier.fillMaxWidth().height(48.dp),
    contentDescription = "Selected color",
)

It takes colors and a shape, as Theming describes. Without Material, a clip, Modifier.checkerboard and a background draw the same: see Without Material.