Skip to main content

SystemColors

Struct SystemColors 

Source
#[repr(C)]
pub struct SystemColors {
Show 21 fields pub text: OptionColorU, pub secondary_text: OptionColorU, pub tertiary_text: OptionColorU, pub background: OptionColorU, pub accent: OptionColorU, pub accent_text: OptionColorU, pub button_face: OptionColorU, pub button_text: OptionColorU, pub disabled_text: OptionColorU, pub window_background: OptionColorU, pub under_page_background: OptionColorU, pub selection_background: OptionColorU, pub selection_text: OptionColorU, pub selection_background_inactive: OptionColorU, pub selection_text_inactive: OptionColorU, pub link: OptionColorU, pub separator: OptionColorU, pub grid: OptionColorU, pub find_highlight: OptionColorU, pub sidebar_background: OptionColorU, pub sidebar_selection: OptionColorU,
}
Expand description

Common system colors used for UI elements.

These colors are queried from the operating system and automatically adapt to the current theme (light/dark mode) and accent color settings.

On macOS, these correspond to NSColor semantic colors. On Windows, these come from UISettings. On Linux/GTK, these come from the GTK theme.

Fields§

§text: OptionColorU

Primary text color (NSColor.textColor on macOS)

§secondary_text: OptionColorU

Secondary text color for less prominent text (NSColor.secondaryLabelColor)

§tertiary_text: OptionColorU

Tertiary text color for disabled/placeholder text (NSColor.tertiaryLabelColor)

§background: OptionColorU

Background color for content areas (NSColor.textBackgroundColor)

§accent: OptionColorU

System accent color chosen by user (NSColor.controlAccentColor on macOS)

§accent_text: OptionColorU

Text color on accent backgrounds

§button_face: OptionColorU

Button/control background (NSColor.controlColor)

§button_text: OptionColorU

Button/control text color (NSColor.controlTextColor)

§disabled_text: OptionColorU

Disabled control text color (NSColor.disabledControlTextColor)

§window_background: OptionColorU

Window background color (NSColor.windowBackgroundColor)

§under_page_background: OptionColorU

Under-page background color (NSColor.underPageBackgroundColor)

§selection_background: OptionColorU

Selection background when window is focused (NSColor.selectedContentBackgroundColor)

§selection_text: OptionColorU

Selection text color when window is focused

§selection_background_inactive: OptionColorU

Selection background when window is NOT focused (NSColor.unemphasizedSelectedContentBackgroundColor) This is used for :backdrop state styling

§selection_text_inactive: OptionColorU

Selection text color when window is NOT focused

§link: OptionColorU

Link color (NSColor.linkColor)

§separator: OptionColorU

Separator/divider color (NSColor.separatorColor)

§grid: OptionColorU

Grid/table line color (NSColor.gridColor)

§find_highlight: OptionColorU

Find/search highlight color (NSColor.findHighlightColor)

§sidebar_background: OptionColorU

Sidebar background color

§sidebar_selection: OptionColorU

Selected row in sidebar

Trait Implementations§

Source§

impl Clone for SystemColors

Source§

fn clone(&self) -> SystemColors

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 SystemColors

Source§

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

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

impl Default for SystemColors

Source§

fn default() -> SystemColors

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

impl PartialEq for SystemColors

Source§

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

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.