mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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>`.
|
/// An animated value for `<color>`.
|
||||||
pub type Color = GenericColor<RGBA>;
|
pub type Color = GenericColor<RGBA>;
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue