diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-06-11 16:54:27 -0700 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2018-06-12 12:15:18 -0700 |
commit | 4cd16ee63c69d0a80998055a83bd8582edd9639b (patch) | |
tree | e7b118a66517480021dedf344811f82e76ad13ad | |
parent | ab760033fdd480f644b372e45c679804c880ce67 (diff) | |
download | servo-4cd16ee63c69d0a80998055a83bd8582edd9639b.tar.gz servo-4cd16ee63c69d0a80998055a83bd8582edd9639b.zip |
style: Derive Animate for ComplexColorRatios.
-rw-r--r-- | components/style/values/animated/color.rs | 10 | ||||
-rw-r--r-- | components/style/values/generics/color.rs | 2 |
2 files changed, 1 insertions, 11 deletions
diff --git a/components/style/values/animated/color.rs b/components/style/values/animated/color.rs index 6a82896d62b..1b01a86457a 100644 --- a/components/style/values/animated/color.rs +++ b/components/style/values/animated/color.rs @@ -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>`. pub type Color = GenericColor<RGBA>; diff --git a/components/style/values/generics/color.rs b/components/style/values/generics/color.rs index 693803ad5fd..e84bd690c7c 100644 --- a/components/style/values/generics/color.rs +++ b/components/style/values/generics/color.rs @@ -6,7 +6,7 @@ /// Ratios representing the contribution of color and currentcolor to /// the final color value. -#[derive(Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)] +#[derive(Animate, Clone, Copy, Debug, MallocSizeOf, PartialEq, ToAnimatedValue)] pub struct ComplexColorRatios { /// Numeric color contribution. pub bg: f32, |