Class ColorExtensions
- Namespace
- AlohaKit.Animations
- Assembly
- AlohaKit.Animations.dll
The ColorExtensions class contains methods to animate color changes and manage color animations for visual elements.
public static class ColorExtensions
- Inheritance
-
ColorExtensions
- Inherited Members
Methods
CancelAnimation(VisualElement)
Cancels the color animation on the specified visual element.
public static void CancelAnimation(this VisualElement self)
Parameters
selfVisualElementThe visual element on which to cancel the color animation.
ColorTo(VisualElement, Color, Color, Action<Color>, uint, Easing)
Animates the transition of a color property from one value to another on the specified visual element.
public static Task<bool> ColorTo(this VisualElement self, Color fromColor, Color toColor, Action<Color> callback, uint length = 250, Easing easing = null)
Parameters
selfVisualElementThe visual element to which the color animation is applied.
fromColorColorThe starting color value.
toColorColorThe target color value.
callbackAction<Color>A callback function to handle the interpolated color during the animation.
lengthuintThe duration of the animation in milliseconds (default is 250).
easingEasingThe easing function to apply to the animation (default is linear).