pub enum ThemeTextColor {
OnSurface,
OnPrimary,
OnSurfaceVariant,
OnPrimaryContainer,
Error,
}Expand description
Which themed color role a text’s glyphs default to when no explicit
.color()/.style() was set and a theme is active.
A plain text defaults to ThemeTextColor::OnSurface (body text on the
app surface); a crate::Button’s label is built with
ThemeTextColor::OnPrimary so it reads correctly against the primary-filled
button. The role is only consulted when the color was not set explicitly —
an app-supplied .color() always wins (precedence: explicit > theme >
fallback). With no theme threaded in, the style’s own color (black by default)
is the unthemed fallback.
Part of the widget-authoring toolkit — re-exported as
crate::authoring::ThemeTextColor, which is the path a design system
outside this crate names it by.
Variants§
OnSurface
colors.on_surface — the default for standalone/body text.
OnPrimary
colors.on_primary — a label painted over a primary-filled surface
(used by crate::Button).
OnSurfaceVariant
colors.on_surface_variant — a de-emphasized label/caption on the app
surface (a navigation bar’s unselected item labels, an app bar’s
trailing action slots).
OnPrimaryContainer
colors.on_primary_container — a label painted over a
primary_container-filled surface (an extended FAB’s visible label).
Error
colors.error — a label reading as a destructive/error action (used
by crate::Button’s ButtonStyle::Danger).
Trait Implementations§
Source§impl Clone for ThemeTextColor
impl Clone for ThemeTextColor
Source§fn clone(&self) -> ThemeTextColor
fn clone(&self) -> ThemeTextColor
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 ThemeTextColor
Source§impl Debug for ThemeTextColor
impl Debug for ThemeTextColor
impl Eq for ThemeTextColor
Source§impl PartialEq for ThemeTextColor
impl PartialEq for ThemeTextColor
impl StructuralPartialEq for ThemeTextColor
Auto Trait Implementations§
impl Freeze for ThemeTextColor
impl RefUnwindSafe for ThemeTextColor
impl Send for ThemeTextColor
impl Sync for ThemeTextColor
impl Unpin for ThemeTextColor
impl UnsafeUnpin for ThemeTextColor
impl UnwindSafe for ThemeTextColor
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.