FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MaterialDynamicPalette

    struct · ferroui-themes-material · v0.5.0

    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

    Members

    primary

    primary: MaterialTonalPalette
    

    Source

    secondary

    secondary: MaterialTonalPalette
    

    Source

    tertiary

    tertiary: MaterialTonalPalette
    

    Source

    neutral

    neutral: MaterialTonalPalette
    

    Source

    neutral_variant

    neutral_variant: MaterialTonalPalette
    

    Source

    from_android31_colors

    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

    from_seed

    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

    from_seed_with_spec

    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

    palette

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

    Source

    scheme_android31

    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

    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
    • AnyValue
    • 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.