blob: c4c1a51d40b8c8d9f93312e577828f1f55776b5f [file] [log] [blame]
package com.airbnb.lottie.animation.keyframe;
import com.airbnb.lottie.model.content.GradientColor;
import com.airbnb.lottie.value.Keyframe;
import java.util.List;
public class GradientColorKeyframeAnimation extends KeyframeAnimation<GradientColor> {
private final GradientColor gradientColor;
public GradientColorKeyframeAnimation(List<Keyframe<GradientColor>> keyframes) {
super(keyframes);
GradientColor startValue = keyframes.get(0).startValue;
int size = startValue == null ? 0 : startValue.getSize();
gradientColor = new GradientColor(new float[size], new int[size]);
}
@Override GradientColor getValue(Keyframe<GradientColor> keyframe, float keyframeProgress) {
gradientColor.lerp(keyframe.startValue, keyframe.endValue, keyframeProgress);
return gradientColor;
}
}