# ColorRoles

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/color/ColorRoles.java)

*** ** * ** ***


```
public final class ColorRoles
```

<br />

*** ** * ** ***

Each accent color (primary, secondary and tertiary), is provided as a group of four supplementary color roles with different luminance which can be used in the UI to define emphasis and to provide a greater flexibility in expression.

## Summary

| ### Public fields |
|---|---|
| `final int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#accent()` |
| `final int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#accentContainer()` |
| `final int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#onAccent()` |
| `final int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#onAccentContainer()` |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#getAccent()()` Returns the accent color, used as the main color from the color role. |
| `int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#getAccentContainer()()` Returns the accent_container color, used with less emphasis than the accent color. |
| `int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#getOnAccent()()` Returns the on_accent color, used for content such as icons and text on top of the Accent color. |
| `int` | `https://developer.android.com/reference/com/google/android/material/color/ColorRoles#getOnAccentContainer()()` Returns the on_accent_container color, used for content such as icons and text on top of the accent_container color. |

## Public fields

### accent

```
public final int accent
```

### accentContainer

```
public final int accentContainer
```

### onAccent

```
public final int onAccent
```

### onAccentContainer

```
public final int onAccentContainer
```

## Public methods

### getAccent

```
public int getAccent()
```

Returns the accent color, used as the main color from the color role.

### getAccentContainer

```
public int getAccentContainer()
```

Returns the accent_container color, used with less emphasis than the accent color.

### getOnAccent

```
public int getOnAccent()
```

Returns the on_accent color, used for content such as icons and text on top of the Accent color.

### getOnAccentContainer

```
public int getOnAccentContainer()
```

Returns the on_accent_container color, used for content such as icons and text on top of the accent_container color.