pub struct LinearGradient {
pub start: Point,
pub end: Point,
pub stops: Vec<GradientStop>,
pub spread: SpreadMethod,
}Expand description
A linear gradient: color stops sweep along the line start → end.
Fields§
§start: Point§end: Point§stops: Vec<GradientStop>§spread: SpreadMethodImplementations§
Source§impl LinearGradient
impl LinearGradient
Sourcepub fn new(start: Point, end: Point) -> Self
pub fn new(start: Point, end: Point) -> Self
Build a LinearGradient from start → end with no stops and
SpreadMethod::Pad.
Sourcepub fn with_stops(self, stops: Vec<GradientStop>) -> Self
pub fn with_stops(self, stops: Vec<GradientStop>) -> Self
Replace the gradient stops.
Sourcepub fn with_stop(self, stop: GradientStop) -> Self
pub fn with_stop(self, stop: GradientStop) -> Self
Append a single stop.
Sourcepub fn with_spread(self, spread: SpreadMethod) -> Self
pub fn with_spread(self, spread: SpreadMethod) -> Self
Set the spread method.
Trait Implementations§
Source§impl Clone for LinearGradient
impl Clone for LinearGradient
Source§fn clone(&self) -> LinearGradient
fn clone(&self) -> LinearGradient
Returns a duplicate of the value. Read more
1.0.0 · 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 LinearGradient
impl RefUnwindSafe for LinearGradient
impl Send for LinearGradient
impl Sync for LinearGradient
impl Unpin for LinearGradient
impl UnsafeUnpin for LinearGradient
impl UnwindSafe for LinearGradient
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