# MaterialDynamicPalette

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-themes-material/struct-materialdynamicpalette/

**struct** · [`ferroui-themes-material`](/docs/0.5.0/api/ferroui-themes-material/) · v0.5.0

```rust
struct MaterialDynamicPalette
```

All five Android tonal palettes, including the full neutral and neutral-variant
ranges. The Android 31–33 mapping deliberately uses neutral-variant surfaces,
as AndroidX does, rather than the older system's lower-chroma neutral palette.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L217)

## Members

- [`primary`](#struct_field-primary)
- [`secondary`](#struct_field-secondary)
- [`tertiary`](#struct_field-tertiary)
- [`neutral`](#struct_field-neutral)
- [`neutral_variant`](#struct_field-neutral_variant)
- [`from_android31_colors`](#function-from_android31_colors)
- [`from_seed`](#function-from_seed)
- [`from_seed_with_spec`](#function-from_seed_with_spec)
- [`palette`](#function-palette)
- [`scheme_android31`](#function-scheme_android31)

<a id="struct_field-primary"></a>

### primary

```rust
primary: MaterialTonalPalette
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L218)

<a id="struct_field-secondary"></a>

### secondary

```rust
secondary: MaterialTonalPalette
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L219)

<a id="struct_field-tertiary"></a>

### tertiary

```rust
tertiary: MaterialTonalPalette
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L220)

<a id="struct_field-neutral"></a>

### neutral

```rust
neutral: MaterialTonalPalette
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L221)

<a id="struct_field-neutral_variant"></a>

### neutral_variant

```rust
neutral_variant: MaterialTonalPalette
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L222)

<a id="function-from_android31_colors"></a>

### from_android31_colors

```rust
fn from_android31_colors(resolve: impl FnMut(MaterialPaletteFamily, u8) -> Option<Color>) -> Result<Self, MaterialDynamicColorError>
```

Imports the complete AndroidX tonal palette. A platform bridge supplies
the system tones and the additional neutral tones calculated by AndroidX
`Color.setLuminance`; values are never regenerated on this path.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L229)

<a id="function-from_seed"></a>

### from_seed

```rust
fn from_seed(seed: Color, style: MaterialPaletteStyle) -> Self
```

Generates five full HCT palettes locally. To reproduce a device wallpaper
scheme exactly, import its system palettes or direct color roles instead.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L280)

<a id="function-from_seed_with_spec"></a>

### from_seed_with_spec

```rust
fn from_seed_with_spec(seed: Color, style: MaterialPaletteStyle, dark: bool, source_spec: MaterialColorSpec) -> Self
```

Generates all five tone palettes for a source specification. In the 2025
phone spec some palette chromas depend on dark mode, so it is explicit.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L286)

<a id="function-palette"></a>

### palette

```rust
fn palette(self: &Self, family: MaterialPaletteFamily) -> &MaterialTonalPalette
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L308)

<a id="function-scheme_android31"></a>

### scheme_android31

```rust
fn scheme_android31(self: &Self, dark: bool) -> Result<MaterialColorScheme, MaterialDynamicColorError>
```

Exact role selection from `dynamicLightColorScheme31` /
`dynamicDarkColorScheme31` in the pinned AndroidX source. Fixed roles do
not change with light/dark mode. Error roles retain the AndroidX defaults.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.Material/dynamic_color.rs#L321)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Equivalent<K>`
- `CastableFrom<ST, Uninit, Uninit>`
- `CastableFrom<ST, Initialized, Initialized>`
- `Read<Exclusive, BecauseExclusive>`
- `Clone`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`
- `Eq`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
