mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
style: Derive Animate for ComplexColorRatios.
This commit is contained in:
parent
ab760033fd
commit
4cd16ee63c
2 changed files with 1 additions and 11 deletions
|
@ -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>;
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue