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 */ }
Expand description
A slice of a Gradient that limits its domain.
Implementations
Get a color from the gradient slice. The color of the closest domain
limit will be returned if i
is outside the domain.
Slice this gradient slice to further limit its domain. Ranges outside the domain will be clamped to the nearest domain limit.
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,
impl<'a, C, T> UnwindSafe for Slice<'a, C, T> where
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>,
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>,
Mutably borrows from an owned value. Read more
Convert into T with values clamped to the color defined bounds Read more
Convert into T. The resulting color might be invalid in its color space Read more
Convert into T, returning ok if the color is inside of its defined
range, otherwise an OutOfBounds
error is returned which contains
the unclamped color. Read more