pub struct GradientFill {
pub gradient_type: GradientType,
pub direction: GradientDirection,
pub stops: Vec<GradientStop>,
pub rotate_with_shape: bool,
}Expand description
Gradient fill definition
Fields§
§gradient_type: GradientTypeGradient type
direction: GradientDirectionDirection (for linear gradients)
stops: Vec<GradientStop>Color stops
rotate_with_shape: boolRotate with shape
Implementations§
Source§impl GradientFill
impl GradientFill
Sourcepub fn new(gradient_type: GradientType) -> Self
pub fn new(gradient_type: GradientType) -> Self
Create a new gradient fill
Sourcepub fn linear(direction: GradientDirection) -> Self
pub fn linear(direction: GradientDirection) -> Self
Create a linear gradient
Sourcepub fn two_color(start_color: &str, end_color: &str) -> Self
pub fn two_color(start_color: &str, end_color: &str) -> Self
Create a simple two-color gradient
Sourcepub fn three_color(
start_color: &str,
middle_color: &str,
end_color: &str,
) -> Self
pub fn three_color( start_color: &str, middle_color: &str, end_color: &str, ) -> Self
Create a three-color gradient
Sourcepub fn add_stop(self, stop: GradientStop) -> Self
pub fn add_stop(self, stop: GradientStop) -> Self
Add a gradient stop
Sourcepub fn with_direction(self, direction: GradientDirection) -> Self
pub fn with_direction(self, direction: GradientDirection) -> Self
Set direction
Sourcepub fn with_rotate(self, rotate: bool) -> Self
pub fn with_rotate(self, rotate: bool) -> Self
Set rotate with shape
Trait Implementations§
Source§impl Clone for GradientFill
impl Clone for GradientFill
Source§fn clone(&self) -> GradientFill
fn clone(&self) -> GradientFill
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for GradientFill
impl RefUnwindSafe for GradientFill
impl Send for GradientFill
impl Sync for GradientFill
impl Unpin for GradientFill
impl UnwindSafe for GradientFill
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more