pub struct Shadow {
pub x: f32,
pub y: f32,
pub blur: f32,
pub spread: f32,
pub color: Color,
pub cut_out: bool,
}Expand description
A shadow cast by a widget’s box, as CSS’s box-shadow: the box’s
shape moved by x and y, grown by spread and blurred over blur
logical pixels. Unlike CSS’s, it is drawn under the box too, so a
translucent background shows it through, unless it is
cut_out.
use crabshell_ui::{Color, Shadow, Style};
const CARD: Style = Style::new()
.background(Color::hex("#1e1e2e"))
.radius(8.0)
.shadow(Shadow::new(0.0, 4.0, 12.0, Color::rgba(0, 0, 0, 96)));Fields§
§x: f32How far right it is moved.
y: f32How far down it is moved.
blur: f32How far its edge is blurred. 0 is a sharp edge.
spread: f32How much larger than the box it is on each side, or smaller when negative.
color: ColorIts color.
cut_out: boolWhether it is left out under the box, as under translucent glass.
Implementations§
Trait Implementations§
impl Copy for Shadow
impl StructuralPartialEq for Shadow
Auto Trait Implementations§
impl Forget for Shadow
impl Freeze for Shadow
impl Move for Shadow
impl RefUnwindSafe for Shadow
impl Send for Shadow
impl Sync for Shadow
impl Unpin for Shadow
impl UnsafeUnpin for Shadow
impl UnwindSafe for Shadow
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