Struct palette::gradient::Slice [−][src]
A slice of a Gradient that limits its domain.
Methods
impl<'a, C: Mix + Clone> Slice<'a, C>
[src]
impl<'a, C: Mix + Clone> Slice<'a, C>
pub fn get(&self, i: C::Scalar) -> C
[src]
pub fn get(&self, i: C::Scalar) -> C
Get a color from the gradient slice. The color of the closest domain
limit will be returned if i
is outside the domain.
ⓘImportant traits for Take<'a, C>pub fn take(&self, n: usize) -> Take<C>
[src]
ⓘImportant traits for Take<'a, C>
pub fn take(&self, n: usize) -> Take<C>
Take n
evenly spaced colors from the gradient slice, as an iterator.
pub fn slice<R: Into<Range<C::Scalar>>>(&self, range: R) -> Slice<C>
[src]
pub fn slice<R: Into<Range<C::Scalar>>>(&self, range: R) -> Slice<C>
Slice this gradient slice to further limit its domain. Ranges outside the domain will be clamped to the nearest domain limit.
pub fn domain(&self) -> (C::Scalar, C::Scalar)
[src]
pub fn domain(&self) -> (C::Scalar, C::Scalar)
Get the limits of this gradient slice's domain.
Trait Implementations
impl<'a, C: Clone + Mix + Clone + 'a> Clone for Slice<'a, C> where
C::Scalar: Clone,
[src]
impl<'a, C: Clone + Mix + Clone + 'a> Clone for Slice<'a, C> where
C::Scalar: Clone,
fn clone(&self) -> Slice<'a, C>
[src]
fn clone(&self) -> Slice<'a, C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<'a, C: Debug + Mix + Clone + 'a> Debug for Slice<'a, C> where
C::Scalar: Debug,
[src]
impl<'a, C: Debug + Mix + Clone + 'a> Debug for Slice<'a, C> where
C::Scalar: Debug,