# DynamicColorSchemeKt

Added in 1.3.0

*** ** * ** ***


```
public final class DynamicColorSchemeKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/material3/ColorScheme` | `https://developer.android.com/reference/androidx/wear/protolayout/material3/DynamicColorSchemeKt#dynamicColorScheme(android.content.Context,androidx.wear.protolayout.material3.ColorScheme)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/material3/ColorScheme defaultColorScheme )` Creates a dynamic color scheme. |
| `static final boolean` | `https://developer.android.com/reference/androidx/wear/protolayout/material3/DynamicColorSchemeKt#isDynamicColorSchemeEnabled(android.content.Context)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context)` Returns whether the dynamic colors scheme (colors following the current system theme) is enabled. |

## Public methods

### dynamicColorScheme

Artifact: [androidx.wear.protolayout:protolayout-material3](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/material3/DynamicColorScheme.kt+function:dynamicColorScheme) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull ColorScheme dynamicColorScheme(
    @NonNull Context context,
    @NonNull ColorScheme defaultColorScheme
)
```

Creates a dynamic color scheme.

Use this function to create a color scheme based on the current system theme. If the user changes the system theme, this color scheme will change accordingly. This function checks whether the dynamic color scheme can be used and returns `https://developer.android.com/reference/androidx/wear/protolayout/material3/package-summary#dynamicColorScheme(android.content.Context,androidx.wear.protolayout.material3.ColorScheme)` otherwise.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | The context required to get system resource data. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/material3/ColorScheme defaultColorScheme` | The fallback `https://developer.android.com/reference/androidx/wear/protolayout/material3/ColorScheme` to return if the dynamic color scheme is switched off or unavailable on this device. |

### isDynamicColorSchemeEnabled

Artifact: [androidx.wear.protolayout:protolayout-material3](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/material3/DynamicColorScheme.kt+function:isDynamicColorSchemeEnabled) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final boolean isDynamicColorSchemeEnabled(@NonNull Context context)
```

Returns whether the dynamic colors scheme (colors following the current system theme) is enabled.

If enabled, and elements or `https://developer.android.com/reference/androidx/wear/protolayout/material3/MaterialScope` are opted in to using dynamic theme, colors will change whenever system theme changes.