FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    CompositionGradientBrush

    struct · ferroui-base · v0.5.0

    struct CompositionGradientBrush
    

    The base of the composition gradient brushes: the gradient stops and the spread method.

    View source

    Members

    from_brush

    fn from_brush(brush: &Rc<CompositionBrush>) -> Option<CompositionGradientBrush>
    

    The handle of brush as a gradient brush, if it is one.

    Source

    gradient_stops

    fn gradient_stops(self: &Self) -> FerroList<Rc<dyn IGradientStop>>
    

    The gradient stops. Mutations of the list itself are not tracked - assign the property to ship in-place edits made after a commit. Stops created via Compositor::create_gradient_stop_with stay live on the server and animate individually; other stops are snapshotted at serialization time.

    Source

    set_gradient_stops

    fn set_gradient_stops(self: &Self, value: FerroList<Rc<dyn IGradientStop>>)
    

    Source

    spread_method

    fn spread_method(self: &Self) -> GradientSpreadMethod
    

    How the gradient repeats outside the stop range.

    Source

    set_spread_method

    fn set_spread_method(self: &Self, value: GradientSpreadMethod)
    

    Source

    anchor_point

    fn anchor_point(self: &Self) -> Vector
    

    The point of the gradient, relative to the size of the painted area, that is placed at offset (animatable as AnchorPoint).

    Source

    set_anchor_point

    fn set_anchor_point(self: &Self, value: Vector)
    

    Source

    center_point

    fn center_point(self: &Self) -> Vector
    

    The point the gradient is scaled and rotated about, in the coordinates of the painted area (animatable as CenterPoint).

    Source

    set_center_point

    fn set_center_point(self: &Self, value: Vector)
    

    Source

    offset

    fn offset(self: &Self) -> Vector
    

    The offset of the gradient (animatable as Offset).

    Source

    set_offset

    fn set_offset(self: &Self, value: Vector)
    

    Source

    rotation_angle

    fn rotation_angle(self: &Self) -> f32
    

    The rotation of the gradient about its centre point, in radians (animatable as RotationAngle).

    Source

    set_rotation_angle

    fn set_rotation_angle(self: &Self, value: f32)
    

    Source

    scale

    fn scale(self: &Self) -> Vector
    

    The scale of the gradient about its centre point (default (1, 1); animatable as Scale).

    Source

    set_scale

    fn set_scale(self: &Self, value: Vector)
    

    Source

    transform_matrix

    fn transform_matrix(self: &Self) -> Matrix
    

    The transform matrix of the gradient (WinUI Matrix3x2; animatable as TransformMatrix).

    Source

    set_transform_matrix

    fn set_transform_matrix(self: &Self, value: Matrix)
    

    Source

    rotation_angle_in_degrees

    fn rotation_angle_in_degrees(self: &Self) -> f32
    

    The rotation in degrees: a view of rotation_angle (not an animation target).

    Source

    set_rotation_angle_in_degrees

    fn set_rotation_angle_in_degrees(self: &Self, value: f32)
    

    Source

    extend_mode

    fn extend_mode(self: &Self) -> CompositionGradientExtendMode
    

    How the gradient continues outside its stops: a view of spread_method (Clamp is Pad, Wrap is Repeat, Mirror is Reflect).

    Source

    set_extend_mode

    fn set_extend_mode(self: &Self, value: CompositionGradientExtendMode)
    

    Source

    interpolation_space

    fn interpolation_space(self: &Self) -> CompositionColorSpace
    

    The colour space the stops are interpolated in.

    Deviation (winui-composition.md): stored only; the drawing contexts interpolate in RGB.

    Source

    set_interpolation_space

    fn set_interpolation_space(self: &Self, value: CompositionColorSpace)
    

    Source

    mapping_mode

    fn mapping_mode(self: &Self) -> CompositionMappingMode
    

    How the points of the WinUI members are measured (default Relative). Changing it keeps the numbers of the points and changes their unit, as WinUI reads the same numbers in the new mode.

    Source

    set_mapping_mode

    fn set_mapping_mode(self: &Self, value: CompositionMappingMode)
    

    Source

    color_stops

    fn color_stops(self: &Self) -> FerroList<Rc<dyn IGradientStop>>
    

    ColorStops: the WinUI name of gradient_stops, with the same rule: a change of the list itself is shipped when the list is assigned again (set_color_stops).

    Source

    set_color_stops

    fn set_color_stops(self: &Self, value: FerroList<Rc<dyn IGradientStop>>)
    

    Source

    Trait implementations

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

    Availability

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