FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    new

    const fn new() -> Self
    

    Creates the default color values: the light theme, no contrast preference and the default accent color.

    Source

    theme_variant

    const fn theme_variant(self: &Self) -> PlatformThemeVariant
    

    System theme variant or mode.

    Source

    with_theme_variant

    const fn with_theme_variant(self: Self, value: PlatformThemeVariant) -> Self
    

    Returns the values with the given theme variant.

    Source

    contrast_preference

    const fn contrast_preference(self: &Self) -> ColorContrastPreference
    

    System high contrast preference.

    Source

    with_contrast_preference

    const fn with_contrast_preference(self: Self, value: ColorContrastPreference) -> Self
    

    Returns the values with the given contrast preference.

    Source

    accent_color1

    const fn accent_color1(self: &Self) -> Color
    

    Primary system accent color.

    Source

    with_accent_color1

    const fn with_accent_color1(self: Self, value: Color) -> Self
    

    Returns the values with the given primary accent color.

    Source

    accent_color2

    fn accent_color2(self: &Self) -> Color
    

    Secondary system accent color. On some platforms can return the same value as accent_color1.

    Source

    with_accent_color2

    const fn with_accent_color2(self: Self, value: Color) -> Self
    

    Returns the values with the given secondary accent color.

    Source

    accent_color3

    fn accent_color3(self: &Self) -> Color
    

    Tertiary system accent color. On some platforms can return the same value as accent_color1.

    Source

    with_accent_color3

    const fn with_accent_color3(self: Self, value: Color) -> Self
    

    Returns the values with the given tertiary accent color.

    Source

    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.

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Hash
    • Default

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.