mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
Introduce ToAnimatedValue 🎥
This commit is contained in:
parent
522d24d126
commit
9ab0b9b4ac
10 changed files with 354 additions and 219 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue