# TopAppBarColors

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/AppBar.kt+class:androidx.compose.material3.TopAppBarColors) Common/AllAndroid/JVM
- Cmn

  ```
  class TopAppBarColors
  ```

*** ** * ** ***

Represents the colors used by a top app bar in different states. This implementation animates the container color according to the top app bar scroll state. It does not animate the leading, headline, or trailing colors.

## Summary

| ### Public constructors |
|---|---|
| `[TopAppBarColors](https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#TopAppBarColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color))( containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, scrolledContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, navigationIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, titleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, actionIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` **This function is deprecated.** Use the TopAppBarColors constructor with subtitleContentColor | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#TopAppBarColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, scrolledContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, navigationIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, titleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, actionIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, subtitleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` create an instance with arbitrary colors, see `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors` for a factory method using the default material3 spec | Cmn |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#copy(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color)( containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, scrolledContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, navigationIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, titleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, actionIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color, subtitleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color )` Returns a copy of this TopAppBarColors, optionally overriding some of the values. | Cmn |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | Cmn |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#hashCode()()` | Cmn |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#actionIconContentColor()` the content color used for actions | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#containerColor()` the color used for the background of this TopAppBar. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#navigationIconContentColor()` the content color used for the navigation icon | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#scrolledContainerColor()` the container color when content is scrolled behind it | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#subtitleContentColor()` the content color used for a subtitle | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#titleContentColor()` the content color used for the title | Cmn |

## Public constructors

### TopAppBarColors

Cmn

```
[TopAppBarColors](https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors#TopAppBarColors(androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color))(
    containerColor: Color,
    scrolledContainerColor: Color,
    navigationIconContentColor: Color,
    titleContentColor: Color,
    actionIconContentColor: Color
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Use the TopAppBarColors constructor with subtitleContentColor, use this instead:
>
> ```kotlin
> TopAppBarColors(containerColor, scrolledContainerColor,navigationIconContentColor, titleContentColor, actionIconContentColor, subtitleContentColor)
> ```

### TopAppBarColors

Cmn

```
TopAppBarColors(
    containerColor: Color,
    scrolledContainerColor: Color,
    navigationIconContentColor: Color,
    titleContentColor: Color,
    actionIconContentColor: Color,
    subtitleContentColor: Color
)
```

create an instance with arbitrary colors, see `https://developer.android.com/reference/kotlin/androidx/compose/material3/TopAppBarColors` for a factory method using the default material3 spec

| Parameters |
|---|---|
| `containerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | the color used for the background of this TopAppBar. Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Transparent()` to have no color. |
| `scrolledContainerColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | the container color when content is scrolled behind it |
| `navigationIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | the content color used for the navigation icon |
| `titleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | the content color used for the title |
| `actionIconContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | the content color used for actions |
| `subtitleContentColor: https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color` | the content color used for a subtitle |

## Public functions

### copy

Cmn

```
fun copy(
    containerColor: Color = this.containerColor,
    scrolledContainerColor: Color = this.scrolledContainerColor,
    navigationIconContentColor: Color = this.navigationIconContentColor,
    titleContentColor: Color = this.titleContentColor,
    actionIconContentColor: Color = this.actionIconContentColor,
    subtitleContentColor: Color = this.subtitleContentColor
): TopAppBarColors
```

Returns a copy of this TopAppBarColors, optionally overriding some of the values. This uses the Color.Unspecified to mean "use the value from the source"

### equals

Cmn

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

### hashCode

Cmn

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

## Public properties

### actionIconContentColor

Cmn

```
val actionIconContentColor: Color
```

the content color used for actions

### containerColor

Cmn

```
val containerColor: Color
```

the color used for the background of this TopAppBar. Use `https://developer.android.com/reference/kotlin/androidx/compose/ui/graphics/Color#Transparent()` to have no color.

### navigationIconContentColor

Cmn

```
val navigationIconContentColor: Color
```

the content color used for the navigation icon

### scrolledContainerColor

Cmn

```
val scrolledContainerColor: Color
```

the container color when content is scrolled behind it

### subtitleContentColor

Cmn

```
val subtitleContentColor: Color
```

the content color used for a subtitle

### titleContentColor

Cmn

```
val titleContentColor: Color
```

the content color used for the title