# MaterialTonalPalette

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

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

```rust
struct MaterialTonalPalette
```

An imported or HCT-generated tonal palette. Imported ARGB values are preserved
exactly. Sparse palettes are supported, but scheme creation fails for missing tones.

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

## Members

- [`ANDROID_SYSTEM_TONES`](#assoc_const-android_system_tones)
- [`ANDROID_NEUTRAL_TONES`](#assoc_const-android_neutral_tones)
- [`from_tones`](#function-from_tones)
- [`from_colors`](#function-from_colors)
- [`from_hct`](#function-from_hct)
- [`tone`](#function-tone)

<a id="assoc_const-android_system_tones"></a>

### ANDROID_SYSTEM_TONES

```rust
const ANDROID_SYSTEM_TONES: [u8; 13]
```

Tones exposed as the thirteen Android 12 system accent/neutral resources.

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

<a id="assoc_const-android_neutral_tones"></a>

### ANDROID_NEUTRAL_TONES

```rust
const ANDROID_NEUTRAL_TONES: [u8; 24]
```

The complete neutral range read or calculated by AndroidX Material3.

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

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

### from_tones

```rust
fn from_tones(tones: impl IntoIterator<Item = (u8, Color)>) -> Result<Self, MaterialDynamicColorError>
```



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

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

### from_colors

```rust
fn from_colors(tones: [Color; 101]) -> Self
```



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

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

### from_hct

```rust
fn from_hct(hue: f64, chroma: f64) -> Result<Self, MaterialDynamicColorError>
```

Generates all integer tones using the actual HCT gamut solver. Hue is
normalized modulo 360; no RGB blending or fixed channel offsets are used.

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

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

### tone

```rust
fn tone(self: &Self, tone: u8) -> Option<Color>
```



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

## 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/).
