pub trait Interpolate {
// Required methods
fn fill_missing_components(&mut self, other: &Self);
fn premultiply(&mut self);
fn unpremultiply(&mut self, alpha_multiplier: f32);
fn interpolate(&self, p1: f32, other: &Self, p2: f32) -> Self;
// Provided methods
fn adjust_powerless_components(&mut self) { ... }
fn adjust_hue(&mut self, _: &mut Self, _: HueInterpolationMethod) { ... }
}Expand description
A trait that colors implement to support interpolation.
Required Methods§
Sourcefn fill_missing_components(&mut self, other: &Self)
fn fill_missing_components(&mut self, other: &Self)
Fills missing components (represented as NaN) to match the other color to interpolate with.
Sourcefn premultiply(&mut self)
fn premultiply(&mut self)
Premultiplies the color by its alpha value.
Sourcefn unpremultiply(&mut self, alpha_multiplier: f32)
fn unpremultiply(&mut self, alpha_multiplier: f32)
Un-premultiplies the color by the given alpha multiplier.
Sourcefn interpolate(&self, p1: f32, other: &Self, p2: f32) -> Self
fn interpolate(&self, p1: f32, other: &Self, p2: f32) -> Self
Interpolates the color with another using the given amounts of each.
Provided Methods§
Sourcefn adjust_powerless_components(&mut self)
fn adjust_powerless_components(&mut self)
Adjusts components that are powerless to be NaN.
Sourcefn adjust_hue(&mut self, _: &mut Self, _: HueInterpolationMethod)
fn adjust_hue(&mut self, _: &mut Self, _: HueInterpolationMethod)
Adjusts the color hue according to the given hue interpolation method.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".