pub struct LinearGradient { /* private fields */ }Expand description
A linear gradient defined by two endpoints and a list of color stops.
Used to create smooth color transitions along a straight line for fill or stroke operations on the canvas.
Implementations§
Source§impl LinearGradient
Implements construction and canvas gradient creation for LinearGradient.
impl LinearGradient
Implements construction and canvas gradient creation for LinearGradient.
Sourcepub fn to_canvas_gradient(
&self,
context: &CanvasRenderingContext2d,
) -> Option<CanvasGradient>
pub fn to_canvas_gradient( &self, context: &CanvasRenderingContext2d, ) -> Option<CanvasGradient>
Source§impl LinearGradient
impl LinearGradient
pub fn get_start(&self) -> Vector2D
pub fn get_mut_start(&mut self) -> &mut Vector2D
pub fn set_start(&mut self, val: Vector2D) -> &mut Self
pub fn get_end(&self) -> Vector2D
pub fn get_mut_end(&mut self) -> &mut Vector2D
pub fn set_end(&mut self, val: Vector2D) -> &mut Self
pub fn get_stops(&self) -> &Vec<(f64, String)>
pub fn get_mut_stops(&mut self) -> &mut Vec<(f64, String)>
pub fn set_stops(&mut self, val: Vec<(f64, String)>) -> &mut Self
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinearGradient
impl Debug for LinearGradient
Source§impl PartialEq for LinearGradient
impl PartialEq for LinearGradient
Source§fn eq(&self, other: &LinearGradient) -> bool
fn eq(&self, other: &LinearGradient) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LinearGradient
Auto 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