Struct sixtyfps_corelib::graphics::LinearGradientBrush[][src]

#[repr(transparent)]
pub struct LinearGradientBrush(_);

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

impl LinearGradientBrush[src]

pub fn new(angle: f32, stops: impl IntoIterator<Item = GradientStop>) -> Self[src]

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.

pub fn angle(&self) -> f32[src]

Returns the angle of the linear gradient in degrees.

pub fn stops<'a>(&'a self) -> impl Iterator<Item = &'a GradientStop> + 'a[src]

Returns the color stops of the linear gradient. The stops are sorted by positions.

Trait Implementations

impl Clone for LinearGradientBrush[src]

impl Debug for LinearGradientBrush[src]

impl From<LinearGradientBrush> for Brush[src]

impl PartialEq<LinearGradientBrush> for LinearGradientBrush[src]

impl StructuralPartialEq for LinearGradientBrush[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.