FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    KnownColors

    struct · ferroui-base · v0.5.0

    struct KnownColors
    

    Lookups between color names and known colors.

    View source

    Members

    get_known_color

    fn get_known_color(s: &str) -> KnownColor
    

    Gets the known color with the given name (ASCII case-insensitive), or KnownColor::NONE when there is no such color.

    Source

    get_known_color_name

    fn get_known_color_name(rgb: u32) -> Option<&'static str>
    

    Gets the name of the known color with the given ARGB value. When several names share the value, the first one in declaration order is returned.

    Source

    try_get_known_color_name

    fn try_get_known_color_name(rgb: u32) -> Option<&'static str>
    

    Same as get_known_color_name.

    Source

    values

    fn values() -> impl Iterator<Item = KnownColor>
    

    The known colors in ascending order of their ARGB values, one per value: the counterpart of Enum.GetValues<KnownColor>() without None (which the original lists first) and without the second name of a shared value, which has the same value and the same name (get_known_color_name).

    Source

    to_color

    const fn to_color(color: KnownColor) -> Color
    

    Converts the known color to a Color.

    Source

    get_known_brush

    fn get_known_brush(s: &str) -> Option<Rc<ImmutableSolidColorBrush>>
    

    Gets the cached brush of the known color with the given name (ASCII case-insensitive), or None when there is no such color.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither

    Availability

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