# ChipStyle

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/model/ChipStyle.java+class:androidx.car.app.model.ChipStyle) Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

*** ** * ** ***


```
@ExperimentalCarApi
@CarProtocol
@RequiresCarApi(value = 9)
public final class ChipStyle
```

<br />

*** ** * ** ***

Defines the visual style of a `https://developer.android.com/reference/androidx/car/app/model/Chip`.

This style can be used to customize the appearance of the chip, such as its background and content colors.

This style can be set on both the `https://developer.android.com/reference/androidx/car/app/model/ChipSection` to apply to all chips, and/or individually to a single `https://developer.android.com/reference/androidx/car/app/model/Chip`. A common usage pattern is to set a default style on the Section, then override the style of the individual "selected" Chips. Remember that these colors will fall back to host defaults if they are unset or they fail contrast checks.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/model/ChipStyle.Builder` A builder of `https://developer.android.com/reference/androidx/car/app/model/ChipStyle`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/model/ChipStyle#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor` | `https://developer.android.com/reference/androidx/car/app/model/ChipStyle#getBackgroundColor()()` Returns the background color of the chip, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor` | `https://developer.android.com/reference/androidx/car/app/model/ChipStyle#getContentColor()()` Returns the content color of the chip, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor` | `https://developer.android.com/reference/androidx/car/app/model/ChipStyle#getOutlineColor()()` Returns the stroke color of the chip, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Shape` | `https://developer.android.com/reference/androidx/car/app/model/ChipStyle#getShape()()` Returns the shape of the chip, or `null` if not set. |
| `int` | `https://developer.android.com/reference/androidx/car/app/model/ChipStyle#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/model/ChipStyle#toString()()` |

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getBackgroundColor

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
public @Nullable CarColor getBackgroundColor()
```

Returns the background color of the chip, or `null` if not set.

### getContentColor

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
public @Nullable CarColor getContentColor()
```

Returns the content color of the chip, or `null` if not set.

### getOutlineColor

Added in [1.8.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.8.0)

```
public @Nullable CarColor getOutlineColor()
```

Returns the stroke color of the chip, or `null` if not set.

### getShape

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
public @Nullable Shape getShape()
```

Returns the shape of the chip, or `null` if not set.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```