# 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
public class CarIconStyle
```

<br />

*** ** * ** ***

Defines the visual styling applied to a `https://developer.android.com/reference/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/androidx/car/app/model/CarIconStyle#TINTED()`, which instructs the host vehicle system to automatically theme-tint the asset with `https://developer.android.com/reference/androidx/car/app/model/CarColor#DEFAULT()` or applies an explicit solid `https://developer.android.com/reference/androidx/car/app/model/CarColor` tint configured via `https://developer.android.com/reference/androidx/car/app/model/CarIconStyle.Builder#setTint(androidx.car.app.model.CarColor)`.
- **Original (Not Tinted):** Styled with `https://developer.android.com/reference/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/androidx/car/app/model/CarIconStyle#ORIGINAL()` (with no tint and default shape) will be rendered.

## Summary

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

| ### Constants |
|---|---|
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarIconStyle` | `https://developer.android.com/reference/androidx/car/app/model/CarIconStyle#ORIGINAL()` Visual styling for icons that should retain their original colors without allowing host-side tinting. |
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/model/CarIconStyle` | `https://developer.android.com/reference/androidx/car/app/model/CarIconStyle#TINTED()` Visual styling for icons that should be tinted. |

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

## Constants

### ORIGINAL

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

```
public static final @NonNull CarIconStyle ORIGINAL
```

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)

```
public static final @NonNull CarIconStyle TINTED
```

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/androidx/car/app/model/CarIconStyle.Builder#Builder(androidx.car.app.model.CarIconStyle)` with `https://developer.android.com/reference/androidx/car/app/model/CarIconStyle#TINTED()` and call `https://developer.android.com/reference/androidx/car/app/model/CarIconStyle.Builder#setTint(androidx.car.app.model.CarColor)`.

## Public methods

### equals

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

### getShape

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

```
@RequiresCarApi(value = 9)
@ExperimentalCarApi
public @Nullable Shape getShape()
```

Returns the `https://developer.android.com/reference/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)

```
public @Nullable CarColor getTint()
```

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

### hashCode

```
public int hashCode()
```

### toString

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