dynamicColorScheme

Function

Android
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

contextThe context required to get system resource data.