pub struct ColorInterpolator;Expand description
Interpolates Color values per ARGB channel.
Implementations§
Source§impl ColorInterpolator
impl ColorInterpolator
Sourcepub fn instance() -> &'static ColorInterpolator
pub fn instance() -> &'static ColorInterpolator
The shared instance.
Source§impl ColorInterpolator
impl ColorInterpolator
Sourcepub fn lerp_hsl(from: Color, to: Color, progress: f32) -> Color
pub fn lerp_hsl(from: Color, to: Color, progress: f32) -> Color
Interpolates in the HSL colour space, giving from at progress 0 and
to at progress 1 (the expression function ColorLerpHSL and the
Hsl colour space of a colour animation). Saturation, lightness and
alpha are interpolated linearly; the hue takes the shorter way around
the colour wheel, and the hue of an achromatic colour (black, white,
greys) is that of the other colour, so a grey turns into a colour
without passing through other hues.
Sourcepub fn lerp_rgb_linear(from: Color, to: Color, progress: f32) -> Color
pub fn lerp_rgb_linear(from: Color, to: Color, progress: f32) -> Color
Interpolates the red, green and blue channels in linear light (the
RgbLinear colour space): the channels are decoded with the sRGB
transfer function, interpolated, and encoded again. Alpha is
interpolated linearly.
Sourcepub fn lerp_hsl_linear(from: Color, to: Color, progress: f32) -> Color
pub fn lerp_hsl_linear(from: Color, to: Color, progress: f32) -> Color
Interpolates in the HSL colour space of the linear-light colour (the
HslLinear colour space): the channels are decoded with the sRGB
transfer function, the colour is interpolated in HSL as
lerp_hsl does, and the result is encoded again.
Trait Implementations§
Source§impl Clone for ColorInterpolator
impl Clone for ColorInterpolator
impl Copy for ColorInterpolator
Source§impl Debug for ColorInterpolator
impl Debug for ColorInterpolator
Source§impl Default for ColorInterpolator
impl Default for ColorInterpolator
Source§impl IInterpolator<Color> for ColorInterpolator
impl IInterpolator<Color> for ColorInterpolator
Auto Trait Implementations§
impl Freeze for ColorInterpolator
impl RefUnwindSafe for ColorInterpolator
impl Send for ColorInterpolator
impl Sync for ColorInterpolator
impl Unpin for ColorInterpolator
impl UnsafeUnpin for ColorInterpolator
impl UnwindSafe for ColorInterpolator
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more