# Colors

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

*** ** * ** ***


```
public class Colors
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use the new class `https://developer.android.com/reference/androidx/wear/protolayout/material/Colors` which provides the same API and functionality.

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

See `https://developer.android.com/reference/androidx/wear/tiles/material/Colors#DEFAULT()` for default color scheme.

## Summary

| ### Constants |
|---|---|
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/material/Colors` | `https://developer.android.com/reference/androidx/wear/tiles/material/Colors#DEFAULT()` **This field is deprecated.** Deprecated in Java |

| ### Public constructors |
|---|
| `[Colors](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#Colors(int,int,int,int))( @https://developer.android.com/reference/androidx/annotation/ColorInt int primary, @https://developer.android.com/reference/androidx/annotation/ColorInt int onPrimary, @https://developer.android.com/reference/androidx/annotation/ColorInt int surface, @https://developer.android.com/reference/androidx/annotation/ColorInt int onSurface )` **This method is deprecated.** Deprecated in Java |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getOnPrimary](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getOnPrimary())()` **This method is deprecated.** Deprecated in Java |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getOnSurface](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getOnSurface())()` **This method is deprecated.** Deprecated in Java |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getPrimary](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getPrimary())()` **This method is deprecated.** Deprecated in Java |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int` | `[getSurface](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getSurface())()` **This method is deprecated.** Deprecated in Java |

## Constants

### DEFAULT

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public static final @NonNull Colors DEFAULT
```

> [!CAUTION]
> **This field is deprecated.**   
> Deprecated in Java

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

## Public constructors

### Colors

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public [Colors](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#Colors(int,int,int,int))(
    @ColorInt int primary,
    @ColorInt int onPrimary,
    @ColorInt int surface,
    @ColorInt int onSurface
)
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

Constructor for `https://developer.android.com/reference/androidx/wear/tiles/material/Colors` object.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int primary` | The background color to be used for primary components. Should be in ARGB format. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int onPrimary` | The content color or tint color to be used for primary components. Should be in ARGB format. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int surface` | The background color to be used for secondary components. Should be in ARGB format. |
| `@https://developer.android.com/reference/androidx/annotation/ColorInt int onSurface` | The content color or tint color to be used for secondary components. Should be in ARGB format. |

## Public methods

### getOnPrimary

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @ColorInt int [getOnPrimary](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getOnPrimary())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

The onPrimary color to be used on components.

### getOnSurface

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @ColorInt int [getOnSurface](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getOnSurface())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

The onSurface color to be used on components.

### getPrimary

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @ColorInt int [getPrimary](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getPrimary())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

The primary color to be used on components.

### getSurface

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.1.0) Deprecated in [1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.2.0)

```
public @ColorInt int [getSurface](https://developer.android.com/reference/androidx/wear/tiles/material/Colors#getSurface())()
```

> [!CAUTION]
> **This method is deprecated.**   
> Deprecated in Java

The surface color to be used on components.