pub struct RadialGradient {
pub center: (f32, f32),
pub radius: f32,
pub stops: Vec<GradientStop>,
}Expand description
A radial gradient defined by a centre point, a radius, and colour stops.
The gradient transitions from stops[0] at the centre to stops[-1] at
the edge of the circle. Beyond the radius the last stop colour is used.
Fields§
§center: (f32, f32)Centre of the gradient circle (logical pixels).
radius: f32Radius of the gradient circle (logical pixels).
stops: Vec<GradientStop>Colour stops, sorted by ascending offset (0.0 = centre, 1.0 = edge).
Implementations§
Source§impl RadialGradient
impl RadialGradient
Sourcepub fn two_stop(
center: (f32, f32),
radius: f32,
inner: Color,
outer: Color,
) -> Self
pub fn two_stop( center: (f32, f32), radius: f32, inner: Color, outer: Color, ) -> Self
Construct a two-stop radial gradient from inner at the centre to
outer at the edge.
Sourcepub fn new(center: (f32, f32), radius: f32, stops: Vec<GradientStop>) -> Self
pub fn new(center: (f32, f32), radius: f32, stops: Vec<GradientStop>) -> Self
Construct from arbitrary stops; they are sorted by offset internally.
Trait Implementations§
Source§impl Clone for RadialGradient
impl Clone for RadialGradient
Source§fn clone(&self) -> RadialGradient
fn clone(&self) -> RadialGradient
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 moreAuto Trait Implementations§
impl Freeze for RadialGradient
impl RefUnwindSafe for RadialGradient
impl Send for RadialGradient
impl Sync for RadialGradient
impl Unpin for RadialGradient
impl UnsafeUnpin for RadialGradient
impl UnwindSafe for RadialGradient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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