pub struct GlassMaterial {
pub blur_radius_intent: f64,
pub fills_light: Vec<GlassFill>,
pub fills_dark: Vec<GlassFill>,
pub hairline_alpha: f32,
pub shadow: ShadowSpec,
}Expand description
The design-token vocabulary: the Theme bundle plus its
component token tables, flat-re-exported from frust-theme so app code
never names that crate directly. A root component reads the active theme via
use_context::<Theme>(); a widget reads it during paint/layout via
PaintCtx::theme_as/LayoutCtx::theme_as (or Theme::from_paint_ctx).
Includes the glass material tokens — this crate ships the opaque recipe, and a design system authors its own translucent one over the same types:
use frust::GlassScale;
let glass = GlassScale::opaque_material();
assert_eq!(glass.chrome.blur_radius_intent, 0.0);
assert!(glass.control.is_opaque());Also the composable-theming surface:
ThemeBuilder (defineTheme/copyWith analog), the no-lock-in typed
extension slot (ThemeExtensions) plus its first consumer
StatusPalette/StatusColors (success/warning/info), and the motion
vocabulary (MotionDurations/EasingSet) — all flat-re-exported so an
app (or a design-system plugin) authors a theme against frust::* alone.
One glass tier’s recipe: how much background blur it intends, the
translucent washes to composite over light and over dark content, its
specular hairline alpha, and its drop shadow.
blur_radius_intent is an intent in the kit’s blur units, not a rendered
pixel radius — a later painting task maps it to the platform’s blur
primitive. 0.0 means “no lens”: the opaque-material path (see
GlassMaterial::is_opaque).
Fields§
§blur_radius_intent: f64Background-blur intent in a design system’s own blur units; 0.0 is
“no lens”, the opaque path GlassScale::opaque_material takes.
fills_light: Vec<GlassFill>Washes composited over light content, bottom-to-top.
fills_dark: Vec<GlassFill>Washes composited over dark content, bottom-to-top.
hairline_alpha: f32Alpha of the specular hairline edge (white over light, drawn by the
consuming widget). 0.0 on the opaque path.
shadow: ShadowSpecThe tier’s drop shadow.
Implementations§
Source§impl GlassMaterial
impl GlassMaterial
Sourcepub fn is_opaque(&self) -> bool
pub fn is_opaque(&self) -> bool
true when this material carries no background-blur intent — the
opaque-material path a widget takes on the Material design language,
where it paints its surface-container role instead of a lens. The
single-API branch that lets one widget read either design language.
Trait Implementations§
Source§impl Clone for GlassMaterial
impl Clone for GlassMaterial
Source§fn clone(&self) -> GlassMaterial
fn clone(&self) -> GlassMaterial
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GlassMaterial
impl Debug for GlassMaterial
Source§impl PartialEq for GlassMaterial
impl PartialEq for GlassMaterial
impl StructuralPartialEq for GlassMaterial
Auto Trait Implementations§
impl Freeze for GlassMaterial
impl RefUnwindSafe for GlassMaterial
impl Send for GlassMaterial
impl Sync for GlassMaterial
impl Unpin for GlassMaterial
impl UnsafeUnpin for GlassMaterial
impl UnwindSafe for GlassMaterial
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.