Struct Interpolator
pub struct Interpolator {
color1: [f32; 3],
alpha1: f32,
delta_color: [f32; 3],
delta_alpha: f32,
cs: ColorSpaceTag,
missing: Missing,
}Expand description
An intermediate struct used for interpolating between colors.
This is the return value of DynamicColor::interpolate.
Fields§
§color1: [f32; 3]§alpha1: f32§delta_color: [f32; 3]§delta_alpha: f32§cs: ColorSpaceTag§missing: MissingImplementations§
§impl Interpolator
impl Interpolator
pub fn eval(&self, t: f32) -> DynamicColor
pub fn eval(&self, t: f32) -> DynamicColor
Evaluate the color ramp at the given point.
Typically t ranges between 0 and 1, but that is not enforced,
so extrapolation is also possible.
Trait Implementations§
§impl Clone for Interpolator
impl Clone for Interpolator
§fn clone(&self) -> Interpolator
fn clone(&self) -> Interpolator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Interpolator
Auto Trait Implementations§
impl Freeze for Interpolator
impl RefUnwindSafe for Interpolator
impl Send for Interpolator
impl Sync for Interpolator
impl Unpin for Interpolator
impl UnsafeUnpin for Interpolator
impl UnwindSafe for Interpolator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.