style: Derive Animate for ComplexColorRatios.

This commit is contained in:
Emilio Cobos Álvarez 2018-06-11 16:54:27 -07:00
parent ab760033fd
commit 4cd16ee63c
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 1 additions and 11 deletions

View file

@ -92,16 +92,6 @@ impl ComputeSquaredDistance for RGBA {
} }
} }
impl Animate for ComplexColorRatios {
#[inline]
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
let bg = self.bg.animate(&other.bg, procedure)?;
let fg = self.fg.animate(&other.fg, procedure)?;
Ok(ComplexColorRatios { bg, fg })
}
}
/// An animated value for `<color>`. /// An animated value for `<color>`.
pub type Color = GenericColor<RGBA>; pub type Color = GenericColor<RGBA>;

View file

@ -6,7 +6,7 @@
/// Ratios representing the contribution of color and currentcolor to /// Ratios representing the contribution of color and currentcolor to
/// the final color value. /// the final color value.
#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)] #[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)]
pub struct ComplexColorRatios { pub struct ComplexColorRatios {
/// Numeric color contribution. /// Numeric color contribution.
pub bg: f32, pub bg: f32,