#[non_exhaustive]pub struct Colors {
pub background: Color,
pub surface: Color,
pub primary: Color,
pub primary_variant: Color,
pub secondary: Color,
pub secondary_variant: Color,
pub error: Color,
pub on_background: Color,
pub on_surface: Color,
pub on_primary: Color,
pub on_secondary: Color,
pub on_error: Color,
}
Expand description
A set of Colors for theming UI elements.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.background: Color
Background color, used to clear the screen each frame and appears behind scrollable content.
surface: Color
Surface color, used to render surfaces of widgets, cards, sheets, and menus.
primary: Color
Primary color displayed most often across widgets.
primary_variant: Color
Primary variant color.
secondary: Color
Secondary color for accents and distinguishing content, optional.
secondary_variant: Color
Secondary variant color, optional.
error: Color
Error highlighting of text and outlines.
on_background: Color
Text and icon color when rendered over the background color.
on_surface: Color
Text and icon color when rendered over the surface color.
on_primary: Color
Text and icon color when rendered over a primary color.
on_secondary: Color
Text and icon color when rendered over a secondary color.
on_error: Color
Text and icon color when rendered over the error color.
Implementations§
Source§impl Colors
impl Colors
Sourcepub fn on_background(&self) -> Color
pub fn on_background(&self) -> Color
Return the on background overlay color.
Sourcepub fn on_surface(&self) -> Color
pub fn on_surface(&self) -> Color
Return the on surface overlay color.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Colors
impl<'de> Deserialize<'de> for Colors
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for Colors
impl Eq for Colors
impl StructuralPartialEq for Colors
Auto Trait Implementations§
impl Freeze for Colors
impl RefUnwindSafe for Colors
impl Send for Colors
impl Sync for Colors
impl Unpin for Colors
impl UnwindSafe for Colors
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.