pub struct PlatformColorValues { /* private fields */ }Expand description
Information about current system color values, including information about dark mode and accent colors.
It is a value: build one from PlatformColorValues::new with the
with_* methods.
Implementations§
Source§impl PlatformColorValues
impl PlatformColorValues
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates the default color values: the light theme, no contrast preference and the default accent color.
Sourcepub const fn theme_variant(&self) -> PlatformThemeVariant
pub const fn theme_variant(&self) -> PlatformThemeVariant
System theme variant or mode.
Sourcepub const fn with_theme_variant(self, value: PlatformThemeVariant) -> Self
pub const fn with_theme_variant(self, value: PlatformThemeVariant) -> Self
Returns the values with the given theme variant.
Sourcepub const fn contrast_preference(&self) -> ColorContrastPreference
pub const fn contrast_preference(&self) -> ColorContrastPreference
System high contrast preference.
Sourcepub const fn with_contrast_preference(
self,
value: ColorContrastPreference,
) -> Self
pub const fn with_contrast_preference( self, value: ColorContrastPreference, ) -> Self
Returns the values with the given contrast preference.
Sourcepub const fn accent_color1(&self) -> Color
pub const fn accent_color1(&self) -> Color
Primary system accent color.
Sourcepub const fn with_accent_color1(self, value: Color) -> Self
pub const fn with_accent_color1(self, value: Color) -> Self
Returns the values with the given primary accent color.
Sourcepub fn accent_color2(&self) -> Color
pub fn accent_color2(&self) -> Color
Secondary system accent color. On some platforms can return the
same value as accent_color1.
Sourcepub const fn with_accent_color2(self, value: Color) -> Self
pub const fn with_accent_color2(self, value: Color) -> Self
Returns the values with the given secondary accent color.
Sourcepub fn accent_color3(&self) -> Color
pub fn accent_color3(&self) -> Color
Tertiary system accent color. On some platforms can return the same
value as accent_color1.
Sourcepub const fn with_accent_color3(self, value: Color) -> Self
pub const fn with_accent_color3(self, value: Color) -> Self
Returns the values with the given tertiary accent color.
Sourcepub const fn accent_shades(&self) -> Option<AccentColorShades>
pub const fn accent_shades(&self) -> Option<AccentColorShades>
The shades of the primary accent color as the system computes them,
if the platform reports them (Windows does); None otherwise, and by
default. A FerroUI addition.
Sourcepub const fn with_accent_shades(self, value: Option<AccentColorShades>) -> Self
pub const fn with_accent_shades(self, value: Option<AccentColorShades>) -> Self
Returns the values with the given shades of the primary accent color,
or without shades for None.
Trait Implementations§
Source§impl Clone for PlatformColorValues
impl Clone for PlatformColorValues
impl Copy for PlatformColorValues
Source§impl Debug for PlatformColorValues
impl Debug for PlatformColorValues
Source§impl Default for PlatformColorValues
impl Default for PlatformColorValues
impl Eq for PlatformColorValues
Source§impl Hash for PlatformColorValues
impl Hash for PlatformColorValues
Source§impl PartialEq for PlatformColorValues
impl PartialEq for PlatformColorValues
impl StructuralPartialEq for PlatformColorValues
Auto Trait Implementations§
impl Freeze for PlatformColorValues
impl RefUnwindSafe for PlatformColorValues
impl Send for PlatformColorValues
impl Sync for PlatformColorValues
impl Unpin for PlatformColorValues
impl UnsafeUnpin for PlatformColorValues
impl UnwindSafe for PlatformColorValues
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more