Struct palette::gradient::Slice
[−]
[src]
pub struct Slice<'a, C: Mix + Clone + 'a> { /* fields omitted */ }
A slice of a Gradient that limits its domain.
Methods
impl<'a, C: Mix + Clone> Slice<'a, C>
[src]
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.
fn take(&self, n: usize) -> Take<C>
Take n
evenly spaced colors from the gradient slice, as an iterator.
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.
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]
C::Scalar: Clone,
fn clone(&self) -> Slice<'a, C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<'a, C: Debug + Mix + Clone + 'a> Debug for Slice<'a, C> where
C::Scalar: Debug,
[src]
C::Scalar: Debug,