pub struct MaterialTheme {
pub colors: ColorScheme,
pub typography: Typography,
pub motion: MotionScheme,
pub layout: LayoutPolicy,
}Expand description
Application-owned configuration consumed by the Material rendering layer.
Fields§
§colors: ColorSchemeSemantic color roles and appearance for this theme.
typography: TypographyFont families and type scale configuration.
motion: MotionSchemeSpring motion scheme (Standard or Expressive).
layout: LayoutPolicyDesktop density and layout direction policy.
Implementations§
Source§impl MaterialTheme
impl MaterialTheme
Sourcepub fn from_seed_with(
seed: Argb,
appearance: Appearance,
contrast: f64,
variant: DynamicVariant,
spec_version: SpecVersion,
) -> Self
pub fn from_seed_with( seed: Argb, appearance: Appearance, contrast: f64, variant: DynamicVariant, spec_version: SpecVersion, ) -> Self
Generates colors while keeping the default typography, motion, and layout.
Source§impl MaterialTheme
impl MaterialTheme
Sourcepub fn baseline(appearance: Appearance) -> Self
pub fn baseline(appearance: Appearance) -> Self
Creates the baseline theme for an explicit appearance.
Sourcepub fn from_seed(seed: Argb, appearance: Appearance, contrast: f64) -> Self
pub fn from_seed(seed: Argb, appearance: Appearance, contrast: f64) -> Self
Creates a Tonal Spot theme from an opaque sRGB seed. The seed’s alpha is ignored.
Sourcepub fn with_colors(self, colors: ColorScheme) -> Self
pub fn with_colors(self, colors: ColorScheme) -> Self
Replaces the theme’s ColorScheme.
Sourcepub fn with_typography(self, typography: Typography) -> Self
pub fn with_typography(self, typography: Typography) -> Self
Replaces the theme’s Typography configuration.
Sourcepub fn with_motion(self, motion: MotionScheme) -> Self
pub fn with_motion(self, motion: MotionScheme) -> Self
Replaces the theme’s MotionScheme.
Sourcepub fn with_layout(self, layout: LayoutPolicy) -> Self
pub fn with_layout(self, layout: LayoutPolicy) -> Self
Replaces the theme’s LayoutPolicy.
Sourcepub fn with_density(self, density: Density) -> Self
pub fn with_density(self, density: Density) -> Self
Sets the desktop Density in Self::layout.
Sourcepub fn with_direction(self, direction: Direction) -> Self
pub fn with_direction(self, direction: Direction) -> Self
Sets the layout Direction in Self::layout.
Trait Implementations§
Source§impl Clone for MaterialTheme
impl Clone for MaterialTheme
Source§impl Debug for MaterialTheme
impl Debug for MaterialTheme
Source§impl Default for MaterialTheme
impl Default for MaterialTheme
Source§impl<'de> Deserialize<'de> for MaterialTheme
impl<'de> Deserialize<'de> for MaterialTheme
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MaterialTheme
impl PartialEq for MaterialTheme
Source§impl Serialize for MaterialTheme
impl Serialize for MaterialTheme
impl StructuralPartialEq for MaterialTheme
Auto Trait Implementations§
impl Forget for MaterialTheme
impl Freeze for MaterialTheme
impl Move for MaterialTheme
impl RefUnwindSafe for MaterialTheme
impl Send for MaterialTheme
impl Sync for MaterialTheme
impl Unpin for MaterialTheme
impl UnsafeUnpin for MaterialTheme
impl UnwindSafe for MaterialTheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more