Introduce ToAnimatedValue 🎥

This commit is contained in:
Anthony Ramine 2017-06-29 13:35:40 +02:00
parent 522d24d126
commit 9ab0b9b4ac
10 changed files with 354 additions and 219 deletions

View file

@ -7,12 +7,13 @@ use cssparser::RGBA;
use style::properties::animated_properties::{Animatable, IntermediateRGBA};
use style::properties::longhands::transform::computed_value::ComputedOperation as TransformOperation;
use style::properties::longhands::transform::computed_value::T as TransformList;
use style::values::animated::ToAnimatedValue;
use style::values::specified::length::Percentage;
fn interpolate_rgba(from: RGBA, to: RGBA, progress: f64) -> RGBA {
let from: IntermediateRGBA = from.into();
let to: IntermediateRGBA = to.into();
from.interpolate(&to, progress).unwrap().into()
let from = from.to_animated_value();
let to = to.to_animated_value();
RGBA::from_animated_value(from.interpolate(&to, progress).unwrap())
}
// Color