pub struct GradientRadius {
pub base: GradientRadiusBase,
pub circle: bool,
pub radii: Size,
}
Expand description
The radial gradient radius length in both dimensions.
Fields§
§base: GradientRadiusBase
How the base length is calculated. The base length is the 100.pct()
length.
circle: bool
If the gradient is circular or elliptical.
If true
the radius is the same in both dimensions, if false
the radius can be different.
radii: Size
The length of the rendered gradient stops.
Implementations§
source§impl GradientRadius
impl GradientRadius
sourcepub fn closest_side(radius: impl Into<Size>) -> Self
pub fn closest_side(radius: impl Into<Size>) -> Self
Ellipse radii relative from center to the closest edge.
sourcepub fn closest_corner(radius: impl Into<Size>) -> Self
pub fn closest_corner(radius: impl Into<Size>) -> Self
Ellipse radii relative from center to the closest corner.
sourcepub fn farthest_side(radius: impl Into<Size>) -> Self
pub fn farthest_side(radius: impl Into<Size>) -> Self
Ellipse radii relative from center to the farthest edge.
sourcepub fn farthest_corner(radius: impl Into<Size>) -> Self
pub fn farthest_corner(radius: impl Into<Size>) -> Self
Ellipse radii relative from center to the farthest corner.
Trait Implementations§
source§impl Clone for GradientRadius
impl Clone for GradientRadius
source§fn clone(&self) -> GradientRadius
fn clone(&self) -> GradientRadius
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GradientRadius
impl Debug for GradientRadius
source§impl<'de> Deserialize<'de> for GradientRadius
impl<'de> Deserialize<'de> for GradientRadius
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<B: Into<GradientRadiusBase>, R: Into<Length>> From<(B, R)> for GradientRadius
impl<B: Into<GradientRadiusBase>, R: Into<Length>> From<(B, R)> for GradientRadius
source§fn from((base, radius): (B, R)) -> Self
fn from((base, radius): (B, R)) -> Self
Ellipse GradientRadiusBase
and ellipse radius.
source§impl From<Dip> for GradientRadius
impl From<Dip> for GradientRadius
source§fn from(l: Dip) -> Self
fn from(l: Dip) -> Self
Conversion to Length::Dip
and to radius.
source§impl From<Factor> for GradientRadius
impl From<Factor> for GradientRadius
source§fn from(norm: Factor) -> Self
fn from(norm: Factor) -> Self
Conversion to Length::Factor
and to radius.
source§impl From<FactorPercent> for GradientRadius
impl From<FactorPercent> for GradientRadius
source§fn from(percent: FactorPercent) -> Self
fn from(percent: FactorPercent) -> Self
Conversion to Length::Factor
and to radius.
source§impl From<GradientRadiusBase> for GradientRadius
impl From<GradientRadiusBase> for GradientRadius
source§fn from(base: GradientRadiusBase) -> Self
fn from(base: GradientRadiusBase) -> Self
Ellipse fill the base radius.
source§impl From<Length> for GradientRadius
impl From<Length> for GradientRadius
source§fn from(radius: Length) -> Self
fn from(radius: Length) -> Self
Ellipse GradientRadius::farthest_corner
.
source§impl From<Px> for GradientRadius
impl From<Px> for GradientRadius
source§fn from(l: Px) -> Self
fn from(l: Px) -> Self
Conversion to Length::Px
and to radius.
source§impl From<Size> for GradientRadius
impl From<Size> for GradientRadius
source§fn from(radii: Size) -> Self
fn from(radii: Size) -> Self
Ellipse GradientRadius::farthest_corner
.
source§impl From<f32> for GradientRadius
impl From<f32> for GradientRadius
source§fn from(f: f32) -> Self
fn from(f: f32) -> Self
Conversion to Length::DipF32
and to radius.
source§impl From<i32> for GradientRadius
impl From<i32> for GradientRadius
source§fn from(i: i32) -> Self
fn from(i: i32) -> Self
Conversion to Length::Dip
and to radius.
source§impl<B: Into<GradientRadiusBase>, R: Into<Length>> IntoVar<GradientRadius> for (B, R)
impl<B: Into<GradientRadiusBase>, R: Into<Length>> IntoVar<GradientRadius> for (B, R)
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Ellipse GradientRadiusBase
and ellipse radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for Dip
impl IntoVar<GradientRadius> for Dip
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Conversion to Length::Dip
and to radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for Factor
impl IntoVar<GradientRadius> for Factor
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Conversion to Length::Factor
and to radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for FactorPercent
impl IntoVar<GradientRadius> for FactorPercent
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Conversion to Length::Factor
and to radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for GradientRadiusBase
impl IntoVar<GradientRadius> for GradientRadiusBase
source§impl IntoVar<GradientRadius> for Length
impl IntoVar<GradientRadius> for Length
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Ellipse GradientRadius::farthest_corner
.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for Px
impl IntoVar<GradientRadius> for Px
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Conversion to Length::Px
and to radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for Size
impl IntoVar<GradientRadius> for Size
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Ellipse GradientRadius::farthest_corner
.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for f32
impl IntoVar<GradientRadius> for f32
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Conversion to Length::DipF32
and to radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl IntoVar<GradientRadius> for i32
impl IntoVar<GradientRadius> for i32
source§fn into_var(self) -> Self::Var
fn into_var(self) -> Self::Var
Conversion to Length::Dip
and to radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
BoxedVar<T>
. Read moresource§impl PartialEq for GradientRadius
impl PartialEq for GradientRadius
source§impl Serialize for GradientRadius
impl Serialize for GradientRadius
impl<B: Into<GradientRadiusBase>, R: Into<Length>> IntoValue<GradientRadius> for (B, R)
impl IntoValue<GradientRadius> for Dip
impl IntoValue<GradientRadius> for Factor
impl IntoValue<GradientRadius> for FactorPercent
impl IntoValue<GradientRadius> for GradientRadiusBase
impl IntoValue<GradientRadius> for Length
impl IntoValue<GradientRadius> for Px
impl IntoValue<GradientRadius> for Size
impl IntoValue<GradientRadius> for f32
impl IntoValue<GradientRadius> for i32
impl StructuralPartialEq for GradientRadius
Auto Trait Implementations§
impl Freeze for GradientRadius
impl RefUnwindSafe for GradientRadius
impl Send for GradientRadius
impl Sync for GradientRadius
impl Unpin for GradientRadius
impl UnwindSafe for GradientRadius
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self
equals other
.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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more