Struct i_slint_core::graphics::LinearGradientBrush
source · [−]#[repr(transparent)]pub struct LinearGradientBrush(_);
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
sourceimpl 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
sourceimpl Clone for LinearGradientBrush
impl Clone for LinearGradientBrush
sourcefn clone(&self) -> LinearGradientBrush
fn clone(&self) -> LinearGradientBrush
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LinearGradientBrush
impl Debug for LinearGradientBrush
sourceimpl From<LinearGradientBrush> for Brush
impl From<LinearGradientBrush> for Brush
sourcefn from(original: LinearGradientBrush) -> Brush
fn from(original: LinearGradientBrush) -> Brush
Converts to this type from the input type.
sourceimpl PartialEq<LinearGradientBrush> for LinearGradientBrush
impl PartialEq<LinearGradientBrush> for LinearGradientBrush
sourcefn eq(&self, other: &LinearGradientBrush) -> bool
fn eq(&self, other: &LinearGradientBrush) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LinearGradientBrush) -> bool
fn ne(&self, other: &LinearGradientBrush) -> bool
This method tests for !=
.
impl StructuralPartialEq for LinearGradientBrush
Auto Trait Implementations
impl RefUnwindSafe for LinearGradientBrush
impl Send for LinearGradientBrush
impl !Sync for LinearGradientBrush
impl Unpin for LinearGradientBrush
impl UnwindSafe for LinearGradientBrush
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more