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
impl 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.