PlatformColorValues
struct · ferroui-base · v0.5.0
struct PlatformColorValues
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.
Members
newtheme_variantwith_theme_variantcontrast_preferencewith_contrast_preferenceaccent_color1with_accent_color1accent_color2with_accent_color2accent_color3with_accent_color3accent_shadeswith_accent_shades
new
const fn new() -> Self
Creates the default color values: the light theme, no contrast preference and the default accent color.
theme_variant
const fn theme_variant(self: &Self) -> PlatformThemeVariant
System theme variant or mode.
with_theme_variant
const fn with_theme_variant(self: Self, value: PlatformThemeVariant) -> Self
Returns the values with the given theme variant.
contrast_preference
const fn contrast_preference(self: &Self) -> ColorContrastPreference
System high contrast preference.
with_contrast_preference
const fn with_contrast_preference(self: Self, value: ColorContrastPreference) -> Self
Returns the values with the given contrast preference.
accent_color1
const fn accent_color1(self: &Self) -> Color
Primary system accent color.
with_accent_color1
const fn with_accent_color1(self: Self, value: Color) -> Self
Returns the values with the given primary accent color.
accent_color2
fn accent_color2(self: &Self) -> Color
Secondary system accent color. On some platforms can return the
same value as accent_color1.
with_accent_color2
const fn with_accent_color2(self: Self, value: Color) -> Self
Returns the values with the given secondary accent color.
accent_color3
fn accent_color3(self: &Self) -> Color
Tertiary system accent color. On some platforms can return the same
value as accent_color1.
with_accent_color3
const fn with_accent_color3(self: Self, value: Color) -> Self
Returns the values with the given tertiary accent color.
accent_shades
const fn accent_shades(self: &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.
with_accent_shades
const fn with_accent_shades(self: Self, value: Option<AccentColorShades>) -> Self
Returns the values with the given shades of the primary accent color,
or without shades for None.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeResourceKeyObjectPropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneCopyDebugStructuralPartialEqPartialEqEqHashDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.