# DynamicColorsOptions.Builder

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/color/DynamicColorsOptions.java)

*** ** * ** ***


```
public class DynamicColorsOptions.Builder
```

<br />

*** ** * ** ***

Builder class for specifying options when applying dynamic colors.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder#Builder()()` |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions` | `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder#build()()` |
| `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder` | `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder#setContentBasedSource(Bitmap)(Bitmap contentBasedSource)` Sets the content based source image from which to extract the seed color for the Material color palette. |
| `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder` | `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder#setContentBasedSource(int)(int contentBasedSource)` Sets the content based source color to generate Material color palette. |
| `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder` | `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder#setOnAppliedCallback(com.google.android.material.color.DynamicColors.OnAppliedCallback)( https://developer.android.com/reference/com/google/android/material/color/DynamicColors.OnAppliedCallback onAppliedCallback )` Sets the callback method for after the dynamic colors have been applied. |
| `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder` | `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder#setPrecondition(com.google.android.material.color.DynamicColors.Precondition)(https://developer.android.com/reference/com/google/android/material/color/DynamicColors.Precondition precondition)` Sets the precondition that decides if dynamic colors should be applied. |
| `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder` | `https://developer.android.com/reference/com/google/android/material/color/DynamicColorsOptions.Builder#setThemeOverlay(int)(int themeOverlay)` Sets the resource ID of the theme overlay that provides dynamic color definition. |

## Public constructors

### Builder

```
public Builder()
```

## Public methods

### build

```
public DynamicColorsOptions build()
```

### setContentBasedSource

```
public DynamicColorsOptions.Builder setContentBasedSource(Bitmap contentBasedSource)
```

Sets the content based source image from which to extract the seed color for the Material color palette. Calling this method will clear any source color previously set with #setContentBasedSource(int).

### setContentBasedSource

```
public DynamicColorsOptions.Builder setContentBasedSource(int contentBasedSource)
```

Sets the content based source color to generate Material color palette. Calling this method will clear any source bitmap previously set with #setContentBasedSource(Bitmap).

### setOnAppliedCallback

```
public DynamicColorsOptions.Builder setOnAppliedCallback(
    DynamicColors.OnAppliedCallback onAppliedCallback
)
```

Sets the callback method for after the dynamic colors have been applied.

### setPrecondition

```
public DynamicColorsOptions.Builder setPrecondition(DynamicColors.Precondition precondition)
```

Sets the precondition that decides if dynamic colors should be applied.

### setThemeOverlay

```
public DynamicColorsOptions.Builder setThemeOverlay(int themeOverlay)
```

Sets the resource ID of the theme overlay that provides dynamic color definition.