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§
Sourcefn gradient_direction(self, direction: GradientDirection) -> Self
fn gradient_direction(self, direction: GradientDirection) -> Self
Add a gradient direction
Sourcefn gradient_from(self, color: Color) -> Self
fn gradient_from(self, color: Color) -> Self
Add a gradient from stop
Sourcefn gradient_via(self, color: Color) -> Self
fn gradient_via(self, color: Color) -> Self
Add a gradient via stop
Sourcefn gradient_to(self, color: Color) -> Self
fn gradient_to(self, color: Color) -> Self
Add a gradient to stop
Sourcefn gradient_simple(
self,
direction: GradientDirection,
from: Color,
to: Color,
) -> Self
fn gradient_simple( self, direction: GradientDirection, from: Color, to: Color, ) -> Self
Add a simple two-color gradient
Sourcefn gradient_three(
self,
direction: GradientDirection,
from: Color,
via: Color,
to: Color,
) -> Self
fn gradient_three( self, direction: GradientDirection, from: Color, via: Color, to: Color, ) -> Self
Add a three-color gradient
Sourcefn gradient_from_names(
self,
direction: GradientDirection,
from: &str,
to: &str,
) -> Self
fn gradient_from_names( self, direction: GradientDirection, from: &str, to: &str, ) -> Self
Add a gradient from color names
Sourcefn gradient_from_names_with_via(
self,
direction: GradientDirection,
from: &str,
via: &str,
to: &str,
) -> Self
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.