pub struct Shadow {
pub color: AlphaColor<Srgb>,
pub blur: f64,
pub dx: f64,
pub dy: f64,
pub spread: f64,
}Expand description
Sombra proyectada detrás del rect del nodo (drop shadow), rasterizada
con el draw_blurred_rounded_rect nativo de vello. Se pinta antes
del relleno, así el fill (si es opaco) tapa la parte solapada y la
sombra sólo asoma por el desenfoque + el offset. El radio sigue al del
nodo (más spread).
Fields§
§color: AlphaColor<Srgb>§blur: f64Desviación estándar del gaussiano (qué tan difusa). En px.
dx: f64Desplazamiento de la sombra respecto del nodo.
dy: f64§spread: f64Cuánto crece (px) el rect de la sombra respecto del nodo.
Implementations§
Source§impl Shadow
impl Shadow
Sourcepub fn new(color: AlphaColor<Srgb>, blur: f64) -> Shadow
pub fn new(color: AlphaColor<Srgb>, blur: f64) -> Shadow
Sombra con color + blur explícitos, sin offset ni spread.
Sourcepub fn soft(alpha: u8, blur: f64) -> Shadow
pub fn soft(alpha: u8, blur: f64) -> Shadow
Elevación suave y tasteful: negro translúcido, leve caída hacia abajo. El default razonable para cards/menús/modales.
pub fn offset(self, dx: f64, dy: f64) -> Shadow
pub fn spread(self, spread: f64) -> Shadow
Trait Implementations§
impl Copy for Shadow
impl StructuralPartialEq for Shadow
Auto Trait Implementations§
impl Freeze 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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.