Skip to main content

ThemeColors

Struct ThemeColors 

Source
#[non_exhaustive]
pub struct ThemeColors {
Show 36 fields pub accent: Option<Rgba>, pub background: Option<Rgba>, pub foreground: Option<Rgba>, pub surface: Option<Rgba>, pub border: Option<Rgba>, pub muted: Option<Rgba>, pub shadow: Option<Rgba>, pub primary_background: Option<Rgba>, pub primary_foreground: Option<Rgba>, pub secondary_background: Option<Rgba>, pub secondary_foreground: Option<Rgba>, pub danger: Option<Rgba>, pub danger_foreground: Option<Rgba>, pub warning: Option<Rgba>, pub warning_foreground: Option<Rgba>, pub success: Option<Rgba>, pub success_foreground: Option<Rgba>, pub info: Option<Rgba>, pub info_foreground: Option<Rgba>, pub selection: Option<Rgba>, pub selection_foreground: Option<Rgba>, pub link: Option<Rgba>, pub focus_ring: Option<Rgba>, pub sidebar: Option<Rgba>, pub sidebar_foreground: Option<Rgba>, pub tooltip: Option<Rgba>, pub tooltip_foreground: Option<Rgba>, pub popover: Option<Rgba>, pub popover_foreground: Option<Rgba>, pub button: Option<Rgba>, pub button_foreground: Option<Rgba>, pub input: Option<Rgba>, pub input_foreground: Option<Rgba>, pub disabled: Option<Rgba>, pub separator: Option<Rgba>, pub alternate_row: Option<Rgba>,
}
Expand description

All theme colors as a flat set of 36 semantic color roles.

Organized into logical groups (core, primary, secondary, status, interactive, panel, component) but stored as direct fields for simpler access and flatter TOML serialization.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§accent: Option<Rgba>

Brand or accent color for interactive elements.

§background: Option<Rgba>

Main application background color.

§foreground: Option<Rgba>

Main text color on the application background.

§surface: Option<Rgba>

Elevated surface color (cards, dialogs).

§border: Option<Rgba>

Default border color.

§muted: Option<Rgba>

Muted/subdued text color for secondary content.

§shadow: Option<Rgba>

Shadow or elevation color.

§primary_background: Option<Rgba>

Primary action background color.

§primary_foreground: Option<Rgba>

Text color on primary background.

§secondary_background: Option<Rgba>

Secondary action background color.

§secondary_foreground: Option<Rgba>

Text color on secondary background.

§danger: Option<Rgba>

Error or danger status color.

§danger_foreground: Option<Rgba>

Text color on danger background.

§warning: Option<Rgba>

Warning status color.

§warning_foreground: Option<Rgba>

Text color on warning background.

§success: Option<Rgba>

Success or positive status color.

§success_foreground: Option<Rgba>

Text color on success background.

§info: Option<Rgba>

Informational status color.

§info_foreground: Option<Rgba>

Text color on info background.

§selection: Option<Rgba>

Background color for selected items.

§selection_foreground: Option<Rgba>

Text color on selected background.

§link: Option<Rgba>

Hyperlink text color.

§focus_ring: Option<Rgba>

Color of keyboard focus indicators.

§sidebar: Option<Rgba>

Sidebar background color.

§sidebar_foreground: Option<Rgba>

Text color on sidebar background.

§tooltip: Option<Rgba>

Tooltip background color.

§tooltip_foreground: Option<Rgba>

Text color on tooltip background.

§popover: Option<Rgba>

Popover/dropdown background color.

§popover_foreground: Option<Rgba>

Text color on popover background.

§button: Option<Rgba>

Button background color.

§button_foreground: Option<Rgba>

Text color on button background.

§input: Option<Rgba>

Text input field background color.

§input_foreground: Option<Rgba>

Text color inside input fields.

§disabled: Option<Rgba>

Color for disabled UI elements.

§separator: Option<Rgba>

Separator/divider line color.

§alternate_row: Option<Rgba>

Alternating row background for lists and tables.

Implementations§

Source§

impl ThemeColors

Source

pub fn merge(&mut self, overlay: &Self)

Merge an overlay into this value. Some fields in the overlay replace the corresponding fields in self; None fields are left unchanged. Nested structs are merged recursively.

Source

pub fn is_empty(&self) -> bool

Returns true if all fields are at their default (None/empty) state.

Trait Implementations§

Source§

impl Clone for ThemeColors

Source§

fn clone(&self) -> ThemeColors

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 ThemeColors

Source§

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

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

impl Default for ThemeColors

Source§

fn default() -> ThemeColors

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

impl<'de> Deserialize<'de> for ThemeColors

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ThemeColors

Source§

fn eq(&self, other: &ThemeColors) -> 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 Serialize for ThemeColors

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ThemeColors

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> 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<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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,