pub struct LinearGradientBrush(/* private fields */);
Expand description
The LinearGradientBrush describes a way of filling a shape with different colors, which are interpolated between different stops. The colors are aligned with a line that’s rotated by the LinearGradient’s angle.
Implementations§
Source§impl LinearGradientBrush
impl LinearGradientBrush
Sourcepub fn new(angle: f32, stops: impl IntoIterator<Item = GradientStop>) -> Self
pub fn new(angle: f32, stops: impl IntoIterator<Item = GradientStop>) -> Self
Creates a new linear gradient, described by the specified angle and the provided color stops.
The angle need to be specified in degrees. The stops don’t need to be sorted as this function will sort them.
Sourcepub fn stops(&self) -> impl Iterator<Item = &GradientStop>
pub fn stops(&self) -> impl Iterator<Item = &GradientStop>
Returns the color stops of the linear gradient. The stops are sorted by positions.
Trait Implementations§
Source§impl Clone for LinearGradientBrush
impl Clone for LinearGradientBrush
Source§fn clone(&self) -> LinearGradientBrush
fn clone(&self) -> LinearGradientBrush
Returns a copy 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 moreSource§impl Debug for LinearGradientBrush
impl Debug for LinearGradientBrush
Source§impl From<LinearGradientBrush> for Brush
impl From<LinearGradientBrush> for Brush
Source§fn from(value: LinearGradientBrush) -> Self
fn from(value: LinearGradientBrush) -> Self
Converts to this type from the input type.
Source§impl PartialEq for LinearGradientBrush
impl PartialEq for LinearGradientBrush
impl StructuralPartialEq for LinearGradientBrush
Auto Trait Implementations§
impl Freeze for LinearGradientBrush
impl RefUnwindSafe for LinearGradientBrush
impl Send for LinearGradientBrush
impl !Sync for LinearGradientBrush
impl Unpin for LinearGradientBrush
impl UnwindSafe for LinearGradientBrush
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