pub struct GradientBuilder { /* private fields */ }
Expand description
Construct a gradient to be used in display lists.
Each gradient needs at least two stops.
Implementations§
Source§impl GradientBuilder
impl GradientBuilder
Sourcepub fn with_stops(stops: Vec<GradientStop>) -> GradientBuilder
pub fn with_stops(stops: Vec<GradientStop>) -> GradientBuilder
Create a gradient builder with a list of stops.
Sourcepub fn push(&mut self, stop: GradientStop)
pub fn push(&mut self, stop: GradientStop)
Push an additional stop for the gradient.
Sourcepub fn stops(&self) -> &[GradientStop]
pub fn stops(&self) -> &[GradientStop]
Get a reference to the list of stops.
Sourcepub fn into_stops(self) -> Vec<GradientStop>
pub fn into_stops(self) -> Vec<GradientStop>
Return the gradient stops vector.
Sourcepub fn gradient(
&mut self,
start_point: LayoutPoint,
end_point: LayoutPoint,
extend_mode: ExtendMode,
) -> Gradient
pub fn gradient( &mut self, start_point: LayoutPoint, end_point: LayoutPoint, extend_mode: ExtendMode, ) -> Gradient
Produce a linear gradient, normalize the stops.
Sourcepub fn radial_gradient(
&mut self,
center: LayoutPoint,
radius: LayoutSize,
extend_mode: ExtendMode,
) -> RadialGradient
pub fn radial_gradient( &mut self, center: LayoutPoint, radius: LayoutSize, extend_mode: ExtendMode, ) -> RadialGradient
Produce a radial gradient, normalize the stops.
Will replace the gradient with a single color if the radius negative.
Sourcepub fn conic_gradient(
&mut self,
center: LayoutPoint,
angle: f32,
extend_mode: ExtendMode,
) -> ConicGradient
pub fn conic_gradient( &mut self, center: LayoutPoint, angle: f32, extend_mode: ExtendMode, ) -> ConicGradient
Produce a conic gradient, normalize the stops.
Auto Trait Implementations§
impl Freeze for GradientBuilder
impl RefUnwindSafe for GradientBuilder
impl Send for GradientBuilder
impl Sync for GradientBuilder
impl Unpin for GradientBuilder
impl UnwindSafe for GradientBuilder
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