pub struct BoxShadow {
pub color: Color,
pub offset: (f32, f32),
pub blur: f32,
pub spread: f32,
pub blur_style: BlurStyle,
}Expand description
A soft drop shadow.
Fields§
§color: ColorColour; its alpha sets the intensity.
offset: (f32, f32)Offset (dx, dy), in logical pixels.
blur: f32Blur radius.
spread: f32How far the shadow grows beyond the box, before blurring.
blur_style: BlurStyleWhich side of the shadow’s edge the blur keeps (milestone 645): both, by default.
Implementations§
Source§impl BoxShadow
impl BoxShadow
Sourcepub const fn new(dx: f32, dy: f32, blur: f32, color: Color) -> BoxShadow
pub const fn new(dx: f32, dy: f32, blur: f32, color: Color) -> BoxShadow
A shadow offset by (dx, dy) with blur, and no spread.
Sourcepub const fn blur_style(self, style: BlurStyle) -> BoxShadow
pub const fn blur_style(self, style: BlurStyle) -> BoxShadow
Sets which side of the edge the blur keeps: a solid shadow with a soft edge, a glow outside the box only, a shading inside it.
Sourcepub fn for_elevation(elevation: f32, color: Color) -> [BoxShadow; 3]
pub fn for_elevation(elevation: f32, color: Color) -> [BoxShadow; 3]
The three shadows a surface elevation high casts, in color: a sharp one close
under it, a softer one further down, and a wide faint one all round. The reference’s
own table, and its three strengths — a fifth, a seventh and an eighth of color’s
opacity — so color is the shadow’s colour at full strength, black by default
(milestone 606).
Between two heights of the table the shadows are interpolated, so a height that animates moves smoothly; past twenty-four, it is twenty-four.
Trait Implementations§
impl Copy for BoxShadow
impl StructuralPartialEq for BoxShadow
Auto Trait Implementations§
impl Freeze for BoxShadow
impl RefUnwindSafe for BoxShadow
impl Send for BoxShadow
impl Sync for BoxShadow
impl Unpin for BoxShadow
impl UnsafeUnpin for BoxShadow
impl UnwindSafe for BoxShadow
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.