(
runtimeScene: RuntimeScene,
identifier: string,
toColorStr: string,
layerName: string,
effectName: string,
propertyName: string,
easing: string,
duration: float
)
| 723 | * @param duration Duration in seconds |
| 724 | */ |
| 725 | export const tweenColorEffectPropertyTween = ( |
| 726 | runtimeScene: RuntimeScene, |
| 727 | identifier: string, |
| 728 | toColorStr: string, |
| 729 | layerName: string, |
| 730 | effectName: string, |
| 731 | propertyName: string, |
| 732 | easing: string, |
| 733 | duration: float |
| 734 | ) => { |
| 735 | const layer = runtimeScene.getLayer(layerName); |
| 736 | const effect = layer.getRendererEffects()[effectName]; |
| 737 | if (!effect) { |
| 738 | logger.error( |
| 739 | `The layer "${layer.getName()}" doesn't have any effect called "${effectName}"` |
| 740 | ); |
| 741 | } |
| 742 | const rgbFromColor = gdjs.hexNumberToRGB( |
| 743 | effect ? effect.getColorParameter(propertyName) : 0 |
| 744 | ); |
| 745 | const rgbToColor: float[] = gdjs.rgbOrHexToRGBColor(toColorStr); |
| 746 | |
| 747 | getTweensMap(runtimeScene).addMultiTween( |
| 748 | identifier, |
| 749 | layer, |
| 750 | duration, |
| 751 | easing, |
| 752 | linearInterpolation, |
| 753 | gdjs.evtTools.tween.rgbToHsl( |
| 754 | rgbFromColor.r, |
| 755 | rgbFromColor.g, |
| 756 | rgbFromColor.b |
| 757 | ), |
| 758 | gdjs.evtTools.tween.rgbToHsl( |
| 759 | rgbToColor[0], |
| 760 | rgbToColor[1], |
| 761 | rgbToColor[2] |
| 762 | ), |
| 763 | getTweenColorEffectPropertySetter(effect, propertyName), |
| 764 | { |
| 765 | type: 'colorEffectProperty', |
| 766 | layerName, |
| 767 | effectName, |
| 768 | propertyName, |
| 769 | } |
| 770 | ); |
| 771 | }; |
| 772 | } |
| 773 | } |
| 774 | } |
nothing calls this directly
no test coverage detected