Struct palette::gradient::Slice [−][src]
pub struct Slice<'a, C, T = Vec<(<C as Mix>::Scalar, C)>> where
C: Mix + Clone + 'a,
T: AsRef<[(C::Scalar, C)]>, { /* fields omitted */ }
A slice of a Gradient that limits its domain.
Implementations
impl<'a, C, T> Slice<'a, C, T> where
C: Mix + Clone + 'a,
T: AsRef<[(C::Scalar, C)]>,
[src]
impl<'a, C, T> Slice<'a, C, T> where
C: Mix + Clone + 'a,
T: AsRef<[(C::Scalar, C)]>,
[src]pub fn get(&self, i: C::Scalar) -> C
[src]
Get a color from the gradient slice. The color of the closest domain
limit will be returned if i
is outside the domain.
pub fn slice<R: Into<Range<C::Scalar>>>(&self, range: R) -> Slice<'_, C, T>
[src]
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]
Get the limits of this gradient slice’s domain.
impl<'a, C, T> Slice<'a, C, T> where
C: Mix + Clone + 'a,
T: AsRef<[(C::Scalar, C)]> + Clone,
[src]
impl<'a, C, T> Slice<'a, C, T> where
C: Mix + Clone + 'a,
T: AsRef<[(C::Scalar, C)]> + Clone,
[src]Trait Implementations
Auto Trait Implementations
impl<'a, C, T> RefUnwindSafe for Slice<'a, C, T> where
C: RefUnwindSafe,
T: RefUnwindSafe,
<C as Mix>::Scalar: RefUnwindSafe,
C: RefUnwindSafe,
T: RefUnwindSafe,
<C as Mix>::Scalar: RefUnwindSafe,
impl<'a, C, T> Send for Slice<'a, C, T> where
C: Sync,
T: Sync,
<C as Mix>::Scalar: Send,
C: Sync,
T: Sync,
<C as Mix>::Scalar: Send,
impl<'a, C, T> Sync for Slice<'a, C, T> where
C: Sync,
T: Sync,
<C as Mix>::Scalar: Sync,
C: Sync,
T: Sync,
<C as Mix>::Scalar: Sync,
impl<'a, C, T> Unpin for Slice<'a, C, T> where
<C as Mix>::Scalar: Unpin,
<C as Mix>::Scalar: Unpin,
impl<'a, C, T> UnwindSafe for Slice<'a, C, T> where
C: RefUnwindSafe,
T: RefUnwindSafe,
<C as Mix>::Scalar: UnwindSafe,
C: RefUnwindSafe,
T: RefUnwindSafe,
<C as Mix>::Scalar: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
[src]
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: FloatComponent,
Swp: WhitePoint,
Dwp: WhitePoint,
D: AdaptFrom<S, Swp, Dwp, T>,
[src]pub fn adapt_into_using<M>(Self, M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
[src]
impl<T, U> IntoColor<U> for T where
U: FromColor<T>,
[src]pub fn into_color(Self) -> U
[src]
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
[src]
impl<T, U> IntoColorUnclamped<U> for T where
U: FromColorUnclamped<T>,
[src]pub fn into_color_unclamped(Self) -> U
[src]
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
[src]
impl<T, U> TryIntoColor<U> for T where
U: TryFromColor<T>,
[src]