# 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)
class ChipStyle
```

<br />

*** ** * ** ***

Defines the visual style of a `https://developer.android.com/reference/kotlin/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/kotlin/androidx/car/app/model/ChipSection` to apply to all chips, and/or individually to a single `https://developer.android.com/reference/kotlin/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 |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle.Builder` A builder of `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle#getBackgroundColor()()` Returns the background color of the chip, or `null` if not set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle#getContentColor()()` Returns the content color of the chip, or `null` if not set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle#getOutlineColor()()` Returns the stroke color of the chip, or `null` if not set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Shape?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle#getShape()()` Returns the shape of the chip, or `null` if not set. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/ChipStyle#toString()()` |

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```

### getBackgroundColor

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

```
fun getBackgroundColor(): CarColor?
```

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)

```
fun getContentColor(): CarColor?
```

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)

```
fun getOutlineColor(): CarColor?
```

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)

```
fun getShape(): Shape?
```

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

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```