---
title: "dynamicColorScheme"
description: "Creates a dynamic color scheme.

Use this function to create a color scheme based on the current watchface. If the user changes
the watchface colors, this color scheme will change accordingly. This function checks whether the
dynamic color scheme can be used and returns null otherwise. It is expected that callers will
check the return value and fallback to their own default color scheme if it is null."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun dynamicColorScheme(context: Context): ColorScheme?
```


Creates a dynamic color scheme.

Use this function to create a color scheme based on the current watchface. If the user changes
the watchface colors, this color scheme will change accordingly. This function checks whether the
dynamic color scheme can be used and returns null otherwise. It is expected that callers will
check the return value and fallback to their own default color scheme if it is null.

#### Parameters

| | |
| --- | --- |
| context | The context required to get system resource data. |




