Struct nannou_core::color::Gradient [−][src]
Expand description
A linear interpolation between colors.
It’s used to smoothly transition between a series of colors, that can be
either evenly spaced or have customized positions. The gradient is
continuous between the control points, but it’s possible to iterate over a
number of evenly spaced points using the take
method. Any point outside
the domain of the gradient will have the same color as the closest control
point.
Implementations
Create a gradient of evenly spaced colors with the domain [0.0, 1.0]. There must be at least one color.
Create a gradient of colors with custom spacing and domain. There must be at least one color and they are expected to be ordered by their position value.
Get a color from the gradient. The color of the closest control point
will be returned if i
is outside the domain.
Take n
evenly spaced colors from the gradient, as an iterator.
Slice this gradient to limit its domain.
Trait Implementations
Auto Trait Implementations
impl<C> RefUnwindSafe for Gradient<C> where
C: RefUnwindSafe,
<C as Mix>::Scalar: RefUnwindSafe,
impl<C> UnwindSafe for Gradient<C> where
C: UnwindSafe,
<C as Mix>::Scalar: UnwindSafe,
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
T: Component + Float,
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: Component + Float,
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