GradientUtilities

Trait GradientUtilities 

Source
pub trait GradientUtilities {
    // Required methods
    fn gradient_direction(self, direction: GradientDirection) -> Self;
    fn gradient_from(self, color: Color) -> Self;
    fn gradient_via(self, color: Color) -> Self;
    fn gradient_to(self, color: Color) -> Self;
    fn gradient(self, gradient: Gradient) -> Self;
    fn gradient_simple(
        self,
        direction: GradientDirection,
        from: Color,
        to: Color,
    ) -> Self;
    fn gradient_three(
        self,
        direction: GradientDirection,
        from: Color,
        via: Color,
        to: Color,
    ) -> Self;
    fn gradient_from_names(
        self,
        direction: GradientDirection,
        from: &str,
        to: &str,
    ) -> Self;
    fn gradient_from_names_with_via(
        self,
        direction: GradientDirection,
        from: &str,
        via: &str,
        to: &str,
    ) -> Self;
}
Expand description

Trait for adding gradient utilities to a class builder

Required Methods§

Source

fn gradient_direction(self, direction: GradientDirection) -> Self

Add a gradient direction

Source

fn gradient_from(self, color: Color) -> Self

Add a gradient from stop

Source

fn gradient_via(self, color: Color) -> Self

Add a gradient via stop

Source

fn gradient_to(self, color: Color) -> Self

Add a gradient to stop

Source

fn gradient(self, gradient: Gradient) -> Self

Add a complete gradient

Source

fn gradient_simple( self, direction: GradientDirection, from: Color, to: Color, ) -> Self

Add a simple two-color gradient

Source

fn gradient_three( self, direction: GradientDirection, from: Color, via: Color, to: Color, ) -> Self

Add a three-color gradient

Source

fn gradient_from_names( self, direction: GradientDirection, from: &str, to: &str, ) -> Self

Add a gradient from color names

Source

fn gradient_from_names_with_via( self, direction: GradientDirection, from: &str, via: &str, to: &str, ) -> Self

Add a gradient from color names with via

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§