# CarIconStyle

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/CarIconStyle.java+class:androidx.car.app.model.CarIconStyle) Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

*** ** * ** ***


```
@CarProtocol
class CarIconStyle
```

<br />

*** ** * ** ***

Defines the visual styling applied to a `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon`, including tinting behavior and geometric shapes.

In general, icon styling falls into two categories:

- **Tinted:** Styled with `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#TINTED()`, which instructs the host vehicle system to automatically theme-tint the asset with `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor#DEFAULT()` or applies an explicit solid `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor` tint configured via `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle.Builder#setTint(androidx.car.app.model.CarColor)`.
- **Original (Not Tinted):** Styled with `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#ORIGINAL()`, which preserves the icon's original colors without allowing host-side tinting (e.g., user avatars, media album art, photos, or un-tinted brand graphics).

If not set, an icon using `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#ORIGINAL()` (with no tint and default shape) will be rendered.

## Summary

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

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#ORIGINAL()` Visual styling for icons that should retain their original colors without allowing host-side tinting. |
| `const https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#TINTED()` Visual styling for icons that should be tinted. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#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/Shape?` | `@https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi(value = 9) @https://developer.android.com/reference/kotlin/androidx/car/app/annotations/ExperimentalCarApi https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#getShape()()` Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Shape` defined in this style, or `null` if none is set. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor?` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#getTint()()` Returns the explicit `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor` tint defined in this style (such as `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor#DEFAULT()` for auto-tinting or a custom tint), or `null` if no tint is applied. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#toString()()` |

## Constants

### ORIGINAL

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

```
const val ORIGINAL: CarIconStyle
```

Visual styling for icons that should retain their original colors without allowing host-side tinting.

Instructs the host vehicle system to preserve the full original colors of the image without host tinting interference. Use this for assets such as user avatars, media album art, photos, or un-tinted logos.

### TINTED

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

```
const val TINTED: CarIconStyle
```

Visual styling for icons that should be tinted.

By default, this instructs the host to automatically tint the icon or allows the dev to provide an explicit custom tint. To apply an explicit custom tint color use `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle.Builder#Builder(androidx.car.app.model.CarIconStyle)` with `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle#TINTED()` and call `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIconStyle.Builder#setTint(androidx.car.app.model.CarColor)`.

## Public functions

### equals

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

### getShape

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

```
@RequiresCarApi(value = 9)
@ExperimentalCarApi
fun getShape(): Shape?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Shape` defined in this style, or `null` if none is set.

### getTint

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

```
fun getTint(): CarColor?
```

Returns the explicit `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor` tint defined in this style (such as `https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor#DEFAULT()` for auto-tinting or a custom tint), or `null` if no tint is applied.

### hashCode

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

### toString

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