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§
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(original: LinearGradientBrush) -> Brush
fn from(original: LinearGradientBrush) -> Brush
Converts to this type from the input type.
source§impl PartialEq<LinearGradientBrush> for LinearGradientBrush
impl PartialEq<LinearGradientBrush> for LinearGradientBrush
source§fn 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 ==.