pub enum FractionalMask {
Linear {
from: (f32, f32),
to: (f32, f32),
from_color: Color,
to_color: Color,
},
Radial {
center: (f32, f32),
radius: f32,
from_color: Color,
to_color: Color,
},
}Expand description
A MaskShader written in fractions of the box it covers — (0, 0) the
top-left corner, (1, 1) the bottom-right.
This is what a caller writes, because a caller knows the shape of the effect it
wants and not the pixels the box will land on. LayerFilter::resolve_mask
turns it into the absolute geometry a scene holds, once the box is known.
Variants§
Linear
A straight fade from from to to.
Fields
Radial
A fade outwards from center, reaching to_color at radius — a fraction
of the box smaller side.
Implementations§
Source§impl FractionalMask
impl FractionalMask
Sourcepub fn fade_out_bottom() -> FractionalMask
pub fn fade_out_bottom() -> FractionalMask
A top-to-bottom fade from opaque to transparent: the common “the list fades out at the bottom” mask, written once.
Trait Implementations§
Source§impl Clone for FractionalMask
impl Clone for FractionalMask
Source§fn clone(&self) -> FractionalMask
fn clone(&self) -> FractionalMask
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FractionalMask
Source§impl Debug for FractionalMask
impl Debug for FractionalMask
Source§impl PartialEq for FractionalMask
impl PartialEq for FractionalMask
impl StructuralPartialEq for FractionalMask
Auto Trait Implementations§
impl Freeze for FractionalMask
impl RefUnwindSafe for FractionalMask
impl Send for FractionalMask
impl Sync for FractionalMask
impl Unpin for FractionalMask
impl UnsafeUnpin for FractionalMask
impl UnwindSafe for FractionalMask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more