@ue-too/animate / index / RGBAnimationHelper
クラス: RGBAnimationHelper
定義: animatable-attribute.ts:299
Interface for type-specific interpolation helpers.
Remarks
Animation helpers provide the lerp (linear interpolation) logic for specific types. Different types require different interpolation strategies:
- Numbers: Simple linear interpolation
- Points: Component-wise interpolation
- Colors (RGB): Component-wise color interpolation
- Strings: Step-based (threshold) interpolation
例
typescript
const myHelper: AnimatableAttributeHelper<number> = {
lerp: (ratio, start, end) => {
const t = (ratio - start.percentage) / (end.percentage - start.percentage);
return start.value + t * (end.value - start.value);
}
};実装
コンストラクター
コンストラクター
new RGBAnimationHelper():
RGBAnimationHelper
定義: animatable-attribute.ts:300
戻り値
RGBAnimationHelper
メソッド
lerp()
lerp(
ratio,start,end):RGB
定義: animatable-attribute.ts:302
Interpolates between two keyframes at a given ratio.
パラメータ
ratio
number
Current animation progress (0.0 to 1.0)
start
Starting keyframe
end
Ending keyframe
戻り値
Interpolated value at the given ratio