Struct tiny_skia::LinearGradient
source · pub struct LinearGradient {
pub(crate) base: Gradient,
}
Expand description
A linear gradient shader.
Fields§
§base: Gradient
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
pub(crate) fn is_opaque(&self) -> bool
pub(crate) fn push_stages(&self, p: &mut RasterPipelineBuilder) -> bool
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
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)