Struct floem_peniko::Gradient
source · pub struct Gradient {
pub kind: GradientKind,
pub extend: Extend,
pub stops: ColorStops,
}
Expand description
Definition of a gradient that transitions between two or more colors.
Fields§
§kind: GradientKind
Kind and properties of the gradient.
extend: Extend
Extend mode.
stops: ColorStops
Color stop collection.
Implementations§
source§impl Gradient
impl Gradient
sourcepub fn new_linear(start: impl Into<Point>, end: impl Into<Point>) -> Self
pub fn new_linear(start: impl Into<Point>, end: impl Into<Point>) -> Self
Creates a new linear gradient for the specified start and end points.
sourcepub fn new_radial(center: impl Into<Point>, radius: f32) -> Self
pub fn new_radial(center: impl Into<Point>, radius: f32) -> Self
Creates a new radial gradient for the specified center point and radius.
sourcepub fn new_two_point_radial(
start_center: impl Into<Point>,
start_radius: f32,
end_center: impl Into<Point>,
end_radius: f32
) -> Self
pub fn new_two_point_radial( start_center: impl Into<Point>, start_radius: f32, end_center: impl Into<Point>, end_radius: f32 ) -> Self
Creates a new two point radial gradient for the specified center points and radii.
sourcepub fn new_sweep(
center: impl Into<Point>,
start_angle: f32,
end_angle: f32
) -> Self
pub fn new_sweep( center: impl Into<Point>, start_angle: f32, end_angle: f32 ) -> Self
Creates a new sweep gradient for the specified center point, start and end angles.
sourcepub fn with_extend(self, mode: Extend) -> Self
pub fn with_extend(self, mode: Extend) -> Self
Builder method for setting the gradient extend mode.
sourcepub fn with_stops(self, stops: impl ColorStopsSource) -> Self
pub fn with_stops(self, stops: impl ColorStopsSource) -> Self
Builder method for setting the color stop collection.
Trait Implementations§
source§impl PartialEq for Gradient
impl PartialEq for Gradient
impl StructuralPartialEq for Gradient
Auto Trait Implementations§
impl RefUnwindSafe for Gradient
impl Send for Gradient
impl Sync for Gradient
impl Unpin 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