# ButtonColors

Artifact: [androidx.wear.protolayout:protolayout-material](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/material/ButtonColors.java+class:androidx.wear.protolayout.material.ButtonColors) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
public class ButtonColors
```

<br />

*** ** * ** ***

Represents the background and content colors used in `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`.

See `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonDefaults#PRIMARY_COLORS()` for the default colors used in a primary styled `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`. See `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonDefaults#SECONDARY_COLORS()` for the default colors used in a secondary styled `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors#ButtonColors(androidx.wear.protolayout.ColorBuilders.ColorProp,androidx.wear.protolayout.ColorBuilders.ColorProp)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorProp backgroundColor, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorProp contentColor )` Constructor for `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object. |
| `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors#ButtonColors(int,int)(@https://developer.android.com/reference/androidx/annotation/ColorInt int backgroundColor, @https://developer.android.com/reference/androidx/annotation/ColorInt int contentColor)` Constructor for `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorProp` | `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors#getBackgroundColor()()` The background color to be used on `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorProp` | `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors#getContentColor()()` The content or tint color to be used on `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` | `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors#primaryButtonColors(androidx.wear.protolayout.material.Colors)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/material/Colors colors)` Returns a `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object, using the current Primary colors from the given `https://developer.android.com/reference/androidx/wear/protolayout/material/Colors`. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` | `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors#secondaryButtonColors(androidx.wear.protolayout.material.Colors)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/material/Colors colors)` Returns a `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object, using the current Surface colors from the given `https://developer.android.com/reference/androidx/wear/protolayout/material/Colors`. |

## Public constructors

### ButtonColors

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public ButtonColors(
    @NonNull ColorBuilders.ColorProp backgroundColor,
    @NonNull ColorBuilders.ColorProp contentColor
)
```

Constructor for `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorProp backgroundColor` | The background color to be used for a button. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ColorBuilders.ColorProp contentColor` | The content color or tint color to be used for a button. |

### ButtonColors

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public ButtonColors(@ColorInt int backgroundColor, @ColorInt int contentColor)
```

Constructor for `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int backgroundColor` | The background color to be used for `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`. Should be in ARGB format. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int contentColor` | The content color or tint color to be used for `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`. Should be in ARGB format. |

## Public methods

### getBackgroundColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public @NonNull ColorBuilders.ColorProp getBackgroundColor()
```

The background color to be used on `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`.

### getContentColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public @NonNull ColorBuilders.ColorProp getContentColor()
```

The content or tint color to be used on `https://developer.android.com/reference/androidx/wear/protolayout/material/Button`.

### primaryButtonColors

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public static @NonNull ButtonColors primaryButtonColors(@NonNull Colors colors)
```

Returns a `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object, using the current Primary colors from the given `https://developer.android.com/reference/androidx/wear/protolayout/material/Colors`.

### secondaryButtonColors

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public static @NonNull ButtonColors secondaryButtonColors(@NonNull Colors colors)
```

Returns a `https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors` object, using the current Surface colors from the given `https://developer.android.com/reference/androidx/wear/protolayout/material/Colors`.