pub struct AxialShading {
pub name: String,
pub start_point: Point,
pub end_point: Point,
pub color_stops: Vec<ColorStop>,
pub extend_start: bool,
pub extend_end: bool,
}Expand description
Axial (linear) shading definition
Fields§
§name: StringShading name for referencing
start_point: PointStart point of the gradient
end_point: PointEnd point of the gradient
color_stops: Vec<ColorStop>Color stops along the gradient
extend_start: boolWhether to extend beyond the start point
extend_end: boolWhether to extend beyond the end point
Implementations§
Source§impl AxialShading
impl AxialShading
Sourcepub fn new(
name: String,
start_point: Point,
end_point: Point,
color_stops: Vec<ColorStop>,
) -> Self
pub fn new( name: String, start_point: Point, end_point: Point, color_stops: Vec<ColorStop>, ) -> Self
Create a new axial shading
Sourcepub fn with_extend(self, extend_start: bool, extend_end: bool) -> Self
pub fn with_extend(self, extend_start: bool, extend_end: bool) -> Self
Set extension options
Sourcepub fn linear_gradient(
name: String,
start_point: Point,
end_point: Point,
start_color: Color,
end_color: Color,
) -> Self
pub fn linear_gradient( name: String, start_point: Point, end_point: Point, start_color: Color, end_color: Color, ) -> Self
Create a simple two-color linear gradient
Sourcepub fn to_pdf_dictionary(&self) -> Result<Dictionary>
pub fn to_pdf_dictionary(&self) -> Result<Dictionary>
Generate PDF shading dictionary
Trait Implementations§
Source§impl Clone for AxialShading
impl Clone for AxialShading
Source§fn clone(&self) -> AxialShading
fn clone(&self) -> AxialShading
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 AxialShading
impl RefUnwindSafe for AxialShading
impl Send for AxialShading
impl Sync for AxialShading
impl Unpin for AxialShading
impl UnwindSafe for AxialShading
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