pub struct StatusPalette {
pub light: StatusColors,
pub dark: StatusColors,
}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.
The success/warning/info extension a crate::theme::Theme carries via
crate::extensions::ThemeExtensions — recovered with
theme.extension::<StatusPalette>().
crate::theme::Theme::neutral attaches StatusPalette::neutral, so
extension::<StatusPalette>() is always Some on the framework’s own
baseline; an app or design system attaches its own table with
theme.extensions.insert(StatusPalette { .. }) (or
ThemeBuilder::extension) to
override it wholesale.
Fields§
§light: StatusColors§dark: StatusColorsImplementations§
Source§impl StatusPalette
impl StatusPalette
Sourcepub fn colors(&self, brightness: Brightness) -> &StatusColors
pub fn colors(&self, brightness: Brightness) -> &StatusColors
The StatusColors for brightness — mirrors
crate::theme::Theme::scheme’s light/dark selector.
Sourcepub const fn neutral() -> StatusPalette
pub const fn neutral() -> StatusPalette
The language-free palette crate::theme::Theme::neutral composes.
Success/warning/info are a functional signal, not a design-language
“look” — the same reasoning ColorScheme::neutral_light/_dark use to
keep error real red instead of grayscaling it too — so the neutral
baseline carries a real three-status table rather than going unset.
The values are the module docs’ community-approximate tone
relationships, stated here in full rather than delegated, so this
constructor stands on its own with every design language out of tree.
Trait Implementations§
Source§impl Clone for StatusPalette
impl Clone for StatusPalette
Source§fn clone(&self) -> StatusPalette
fn clone(&self) -> StatusPalette
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StatusPalette
Source§impl Debug for StatusPalette
impl Debug for StatusPalette
Source§impl PartialEq for StatusPalette
impl PartialEq for StatusPalette
impl StructuralPartialEq for StatusPalette
Auto Trait Implementations§
impl Freeze for StatusPalette
impl RefUnwindSafe for StatusPalette
impl Send for StatusPalette
impl Sync for StatusPalette
impl Unpin for StatusPalette
impl UnsafeUnpin for StatusPalette
impl UnwindSafe for StatusPalette
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.