pub enum Gradient {
Linear {
start_point: Point,
end_point: Point,
color_stops: Vec<ColorStop>,
},
Radial {
center: Point,
radius: f64,
color_stops: Vec<ColorStop>,
},
}Expand description
Gradient type
Variants§
Linear
Linear gradient from start point to end point
Fields
Radial
Radial gradient from center with radius
Implementations§
Source§impl Gradient
impl Gradient
Sourcepub fn linear(
start_point: Point,
end_point: Point,
color_stops: Vec<ColorStop>,
) -> Self
pub fn linear( start_point: Point, end_point: Point, color_stops: Vec<ColorStop>, ) -> Self
Create a linear gradient
Sourcepub fn radial(center: Point, radius: f64, color_stops: Vec<ColorStop>) -> Self
pub fn radial(center: Point, radius: f64, color_stops: Vec<ColorStop>) -> Self
Create a radial gradient
Sourcepub fn linear_from_angle(angle_deg: f64, color_stops: Vec<ColorStop>) -> Self
pub fn linear_from_angle(angle_deg: f64, color_stops: Vec<ColorStop>) -> Self
Create a linear gradient from an angle in degrees
Angle is measured clockwise from top (0° = to top, 90° = to right, etc.)
Trait Implementations§
impl StructuralPartialEq for Gradient
Auto Trait Implementations§
impl Freeze for Gradient
impl RefUnwindSafe for Gradient
impl Send for Gradient
impl Sync for Gradient
impl Unpin for Gradient
impl UnsafeUnpin for Gradient
impl UnwindSafe for Gradient
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