pub struct MaterialTokens {
pub light: MaterialSemanticColors,
pub dark: MaterialSemanticColors,
}Expand description
The Material 3 Expressive semantic-role theme extension:
MaterialSemanticColors for both brightnesses at once, exactly like
frust::Theme’s own light/dark pair. Recovered from a themed app
with theme.extension::<MaterialTokens>().
A Theme is cloned across the framework’s two delivery paths, so an
extension must be Any + Send + Sync — this is plain Color-only data
and satisfies that for free.
Vocabulary note: super::baseline attaches this and a
frust::StatusPalette (via super::status_palette), and both carry
info/success/warning fields at different values. This is by design
— see module docs — and frust-material catalog code must resolve
this type, never StatusPalette.
Fields§
§light: MaterialSemanticColorsThe nine semantic roles, light mode.
dark: MaterialSemanticColorsThe nine semantic roles, dark mode.
Implementations§
Source§impl MaterialTokens
impl MaterialTokens
Sourcepub fn material() -> Self
pub fn material() -> Self
The Material 3 Expressive baseline extension (seed #6750A4) — what
super::baseline attaches.
Sourcepub fn colors(&self, brightness: Brightness) -> &MaterialSemanticColors
pub fn colors(&self, brightness: Brightness) -> &MaterialSemanticColors
The semantic-role table for brightness — mirrors
frust::Theme::scheme’s light/dark selector.
Sourcepub fn resolve_emphasis(explicit: Option<Color>, theme: Option<&Theme>) -> Color
pub fn resolve_emphasis(explicit: Option<Color>, theme: Option<&Theme>) -> Color
Resolve the emphasis role under the framework’s documented
precedence: explicit builder value > theme extension > fallback
constant. The theme rung reads the extension and the theme’s own
brightness, so emphasis follows a live light/dark flip with no
component involvement — the same shape ShadcnTokens::resolve_ring
documents for its own catalog.
Sourcepub fn resolve_danger(explicit: Option<Color>, theme: Option<&Theme>) -> Color
pub fn resolve_danger(explicit: Option<Color>, theme: Option<&Theme>) -> Color
Resolve the danger role under the same ladder as
resolve_emphasis.
Trait Implementations§
Source§impl Clone for MaterialTokens
impl Clone for MaterialTokens
Source§impl Debug for MaterialTokens
impl Debug for MaterialTokens
Source§impl PartialEq for MaterialTokens
impl PartialEq for MaterialTokens
impl StructuralPartialEq for MaterialTokens
Auto Trait Implementations§
impl Freeze for MaterialTokens
impl RefUnwindSafe for MaterialTokens
impl Send for MaterialTokens
impl Sync for MaterialTokens
impl Unpin for MaterialTokens
impl UnsafeUnpin for MaterialTokens
impl UnwindSafe for MaterialTokens
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.