FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ColorToBrushConverter

    struct · ferroui-markup-xaml · v0.5.0

    struct ColorToBrushConverter
    

    Converts a color to a brush when a brush is asked for: what lets a color resource be used where a brush is expected.

    View source

    Members

    new

    fn new() -> Rc<Self>
    

    Source

    convert_to

    fn convert_to(value: Option<BoxedValue>, target_type: Option<ValueType>) -> Option<BoxedValue>
    

    If target_type is the brush type and value is a color: a solid color brush of that color. Otherwise the value unchanged.

    Source

    convert_back_to

    fn convert_back_to(value: Option<BoxedValue>, target_type: Option<ValueType>) -> Option<BoxedValue>
    

    If target_type is the color type and value is a solid color brush: the color of the brush. Otherwise the value unchanged.

    Source

    Trait implementations

    Availability

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