Struct tiny_skia::LinearGradient
source · pub struct LinearGradient { /* private fields */ }
Expand description
A linear gradient shader.
Implementations§
source§impl LinearGradient
impl LinearGradient
sourcepub fn new(
start: Point,
end: Point,
stops: Vec<GradientStop>,
mode: SpreadMode,
transform: Transform,
) -> Option<Shader<'static>>
pub fn new( start: Point, end: Point, stops: Vec<GradientStop>, mode: SpreadMode, transform: Transform, ) -> Option<Shader<'static>>
Creates a new linear gradient shader.
Returns Shader::SolidColor
when:
stops.len()
== 1start
andend
are very close
Returns None
when:
stops
is emptystart
==end
transform
is not invertible
Trait Implementations§
source§impl Clone for LinearGradient
impl Clone for LinearGradient
source§fn clone(&self) -> LinearGradient
fn clone(&self) -> LinearGradient
Returns a copy 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 moresource§impl Debug for LinearGradient
impl Debug for LinearGradient
source§impl PartialEq for LinearGradient
impl PartialEq for LinearGradient
source§fn eq(&self, other: &LinearGradient) -> bool
fn eq(&self, other: &LinearGradient) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for LinearGradient
Auto Trait Implementations§
impl Freeze for LinearGradient
impl RefUnwindSafe for LinearGradient
impl Send for LinearGradient
impl Sync for LinearGradient
impl Unpin for LinearGradient
impl UnwindSafe for LinearGradient
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)