Skip to main content

FsTheme

Struct FsTheme 

Source
pub struct FsTheme {
Show 14 fields pub background: Rgb565, pub surface: Rgb565, pub surface_alt: Rgb565, pub accent: Rgb565, pub text_primary: Rgb565, pub text_secondary: Rgb565, pub text_on_accent: Rgb565, pub success: Rgb565, pub warning: Rgb565, pub danger: Rgb565, pub text_on_danger: Rgb565, pub dim: Rgb565, pub tab_bar_height: u32, pub modal_margin: u32,
}
Expand description

Global semantic palette and sizing metrics used across widgets.

Fields§

§background: Rgb565

Background color for full-screen surfaces.

§surface: Rgb565

Primary card and panel surface color.

§surface_alt: Rgb565

Secondary surface used for separators and contrast.

§accent: Rgb565

Accent color for primary actions and emphasis.

§text_primary: Rgb565

Default foreground color for strong text.

§text_secondary: Rgb565

Secondary foreground color for supporting text.

§text_on_accent: Rgb565

Foreground color to render on accent surfaces.

§success: Rgb565

Semantic success color.

§warning: Rgb565

Semantic warning color.

§danger: Rgb565

Semantic danger or destructive color.

§text_on_danger: Rgb565

Foreground color to render on danger surfaces.

§dim: Rgb565

Base dimming color used for overlays.

§tab_bar_height: u32

Height of the tab bar container.

§modal_margin: u32

Outer margin used when presenting modals.

Implementations§

Source§

impl FsTheme

Source

pub const fn neutral_light() -> Self

Returns the default neutral light palette.

Examples found in repository?
src/theme.rs (line 115)
114    fn default() -> Self {
115        Self::neutral_light()
116    }
Source

pub const fn with_neutral_surfaces( self, background: Rgb565, surface: Rgb565, surface_alt: Rgb565, ) -> Self

Overrides the neutral surface colors.

Source

pub const fn with_text_colors( self, text_primary: Rgb565, text_secondary: Rgb565, ) -> Self

Overrides the primary and secondary text colors.

Source

pub const fn with_accent(self, accent: Rgb565, text_on_accent: Rgb565) -> Self

Overrides the accent color pair.

Source

pub const fn with_status_colors( self, success: Rgb565, warning: Rgb565, danger: Rgb565, text_on_danger: Rgb565, ) -> Self

Overrides the semantic success, warning, and danger colors.

Source

pub const fn with_dim(self, dim: Rgb565) -> Self

Overrides the dimming base color.

Source

pub const fn with_metrics(self, tab_bar_height: u32, modal_margin: u32) -> Self

Overrides common widget metrics.

Trait Implementations§

Source§

impl Clone for FsTheme

Source§

fn clone(&self) -> FsTheme

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FsTheme

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FsTheme

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for FsTheme

Source§

fn eq(&self, other: &FsTheme) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for FsTheme

Source§

impl Eq for FsTheme

Source§

impl StructuralPartialEq for FsTheme

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.