# Colors

# Colors

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/Colors.java+class:androidx.wear.protolayout.material.Colors)  
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/Colors "View this page in Java")


```
class Colors
```

<br />

*** ** * ** ***

Represent the container for default color scheme in your Tile, that can be used to create color objects for all Material components.

See [DEFAULT](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors#DEFAULT()) for default color scheme.

## Summary

|                                               ### Constants                                                |
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Colors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors) | [DEFAULT](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors#DEFAULT()) The default color scheme to be used in ProtoLayout Material components. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Colors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors#Colors(int,int,int,int))`(` ` primary: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` onPrimary: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` surface: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` onSurface: @`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Constructor for [Colors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors) object. |

|                                                                           ### Public functions                                                                           |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `@`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [getOnPrimary](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors#getOnPrimary())`()` The onPrimary color to be used on components. |
| `@`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [getOnSurface](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors#getOnSurface())`()` The onSurface color to be used on components. |
| `@`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [getPrimary](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors#getPrimary())`()` The primary color to be used on components.       |
| `@`[ColorInt](https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt)` `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [getSurface](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/Colors#getSurface())`()` The surface color to be used on components.       |

## Constants

### DEFAULT

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

```
const val DEFAULT: Colors
```

The default color scheme to be used in ProtoLayout Material components.  

## Public constructors

### Colors

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

```
Colors(
    primary: @ColorInt Int,
    onPrimary: @ColorInt Int,
    surface: @ColorInt Int,
    onSurface: @ColorInt Int
)
```

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

|                                                                                     Parameters                                                                                      |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| `primary: @`[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 primary components. Should be in ARGB format.              |
| `onPrimary: @`[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 primary components. Should be in ARGB format.   |
| `surface: @`[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 secondary components. Should be in ARGB format.            |
| `onSurface: @`[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 secondary components. Should be in ARGB format. |

## Public functions

### getOnPrimary

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

```
fun getOnPrimary(): @ColorInt Int
```

The onPrimary color to be used on components.  

### getOnSurface

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

```
fun getOnSurface(): @ColorInt Int
```

The onSurface color to be used on components.  

### getPrimary

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

```
fun getPrimary(): @ColorInt Int
```

The primary color to be used on components.  

### getSurface

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

```
fun getSurface(): @ColorInt Int
```

The surface color to be used on components.