# ButtonColors

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/material/ButtonColors "View this page in Java")

<br />

```
class ButtonColors
```

<br />

*** ** * ** ***

Represents the background and content colors used in[Button](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Button).

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

## Summary

|                                                                                                                                                                                                                                                                                                                           ### Public constructors                                                                                                                                                                                                                                                                                                                            |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors#ButtonColors(androidx.wear.protolayout.ColorBuilders.ColorProp,androidx.wear.protolayout.ColorBuilders.ColorProp))`(` ` backgroundColor: `[ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp)`,` ` contentColor: `[ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp) `)` Constructor for[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors)object. |
| [ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors#ButtonColors(int,int))`(backgroundColor: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, contentColor: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Constructor for[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors)object.               |

|                                                     ### Public functions                                                     |
|------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp)  | [getBackgroundColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors#getBackgroundColor())`()` The background color to be used on[Button](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Button).                                                                                                                                                                                                                                                                                                        |
| [ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp)  | [getContentColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors#getContentColor())`()` The content or tint color to be used on[Button](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Button).                                                                                                                                                                                                                                                                                                         |
| `java-static `[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors) | [primaryButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors#primaryButtonColors(androidx.wear.protolayout.material.Colors))`(colors: `[Colors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors)`)` Returns a[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors)object, using the current Primary colors from the given[Colors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors).     |
| `java-static `[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors) | [secondaryButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors#secondaryButtonColors(androidx.wear.protolayout.material.Colors))`(colors: `[Colors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors)`)` Returns a[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors)object, using the current Surface colors from the given[Colors](https://developer.android.com/reference/kotlin/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)  

```
ButtonColors(
    backgroundColor: ColorBuilders.ColorProp,
    contentColor: ColorBuilders.ColorProp
)
```

Constructor for[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors)object.  

|                                                                   Parameters                                                                   |
|------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------|
| `backgroundColor: `[ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp) | The background color to be used for a button.            |
| `contentColor: `[ColorBuilders.ColorProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/ColorBuilders.ColorProp)    | 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)  

```
ButtonColors(backgroundColor: @ColorInt Int, contentColor: @ColorInt Int)
```

Constructor for[ButtonColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ButtonColors)object.  

|                                                                                        Parameters                                                                                         |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `backgroundColor: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The background color to be used for[Button](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Button). Should be in ARGB format.            |
| `contentColor: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | The content color or tint color to be used for[Button](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Button). Should be in ARGB format. |

## Public functions

### getBackgroundColor

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

```
fun getBackgroundColor(): ColorBuilders.ColorProp
```

The background color to be used on[Button](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Button).  

### getContentColor

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

```
fun getContentColor(): ColorBuilders.ColorProp
```

The content or tint color to be used on[Button](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Button).  

### primaryButtonColors

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

```
java-static fun primaryButtonColors(colors: Colors): ButtonColors
```

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

### secondaryButtonColors

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

```
java-static fun secondaryButtonColors(colors: Colors): ButtonColors
```

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