How do i tween a Color? #53
-
Tween.Color only seems to be able to target UI elements and others with a color field but i just need to tween a color directly (for UI Toolkit stuff) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
There is currently no built-in support for animating UIToolkit color, but it's possible to animate anything with the Custom animation: Color startValue = visualElement.style.color.value;
Color endValue = Color.red;
Tween.Custom(visualElement, startValue, endValue, duration, (target, val) => target.style.color = val); Currently, only these properties are supported. I'll add support for UIToolkit's color and backgroundColor in the next PrimeTween version. Please tell me what other UIToolkit properties you would like to see. |
Beta Was this translation helpful? Give feedback.
-
I added Tween.VisualElementColor/VisualElementBackgroundColor() methods in version 1.1.14 to animate colors of UIToolkit components. |
Beta Was this translation helpful? Give feedback.
There is currently no built-in support for animating UIToolkit color, but it's possible to animate anything with the Custom animation:
Currently, only these properties are supported. I'll add support for UIToolkit's color and backgroundColor in the next PrimeTween version. Please tell me what other UIToolkit properties you would like to see.