Trait lightningcss::values::color::Interpolate
source · pub trait Interpolate {
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;
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.