<div class='sourceset sourceset-android'>Android</div>

```kotlin
public object CardDefaults
```

Contains the default values used by [Card](/jetpack-compose/androidx.wear.compose/compose-material/components/Card)

## Functions

<h2 id="cardbackgroundpainter-startbackgroundcolor-endbackgroundcolor-gradientdirection">cardBackgroundPainter</h2>

```kotlin
@Composable
public fun cardBackgroundPainter(
    startBackgroundColor: Color =
        MaterialTheme.colors.primary
            .copy(alpha = 0.30f)
            .compositeOver(MaterialTheme.colors.background),
    endBackgroundColor: Color =
        MaterialTheme.colors.onSurfaceVariant
            .copy(alpha = 0.20f)
            .compositeOver(MaterialTheme.colors.background),
    gradientDirection: LayoutDirection = LocalLayoutDirection.current,
): Painter
```

Creates a [Painter](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Painter) for background colors for a [Card](/jetpack-compose/androidx.wear.compose/compose-material/components/Card). Cards typically have a linear
gradient for a background. The gradient will be between startBackgroundColor and
endBackgroundColor and at an angle of 45 degrees.

Cards should have a content color that contrasts with the background gradient.

#### Parameters

| | |
| --- | --- |
| startBackgroundColor | The background color used at the start of the gradient of this [Card](/jetpack-compose/androidx.wear.compose/compose-material/components/Card) |
| endBackgroundColor | The background color used at the end of the gradient of this [Card](/jetpack-compose/androidx.wear.compose/compose-material/components/Card) |
| gradientDirection | Whether the cards gradient should be start to end (indicated by [LayoutDirection.Ltr](/jetpack-compose/androidx.compose.ui/ui-unit/classes/LayoutDirection.Ltr)) or end to start (indicated by [LayoutDirection.Rtl](/jetpack-compose/androidx.compose.ui/ui-unit/classes/LayoutDirection.Rtl)). |

<hr class="docs-overload-divider">

<h2 id="imagewithscrimbackgroundpainter-backgroundimagepainter-backgroundimagescrimbrush">imageWithScrimBackgroundPainter</h2>

```kotlin
@Composable
public fun imageWithScrimBackgroundPainter(
    backgroundImagePainter: Painter,
    backgroundImageScrimBrush: Brush =
        Brush.linearGradient(
            colors =
                listOf(
                    MaterialTheme.colors.surface.copy(alpha = 1.0f),
                    MaterialTheme.colors.surface.copy(alpha = 0f),
                )
        ),
): Painter
```

Creates a [Painter](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Painter) for the background of a [Card](/jetpack-compose/androidx.wear.compose/compose-material/components/Card) that displays an Image with a scrim over
the image to make sure that any content above the background will be legible.

An Image background is a means to reinforce the meaning of information in a Card, e.g. To
help to contextualize the information in a TitleCard

Cards should have a content color that contrasts with the background image and scrim

#### Parameters

| | |
| --- | --- |
| backgroundImagePainter | The [Painter](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Painter) to use to draw the background of the [Card](/jetpack-compose/androidx.wear.compose/compose-material/components/Card) |
| backgroundImageScrimBrush | The [Brush](/jetpack-compose/androidx.compose.ui/ui-graphics/classes/Brush) to use to paint a scrim over the background image to ensure that any text drawn over the image is legible |