Table of Contents

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

self VisualElement

The 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

self VisualElement

The visual element to which the color animation is applied.

fromColor Color

The starting color value.

toColor Color

The target color value.

callback Action<Color>

A callback function to handle the interpolated color during the animation.

length uint

The duration of the animation in milliseconds (default is 250).

easing Easing

The easing function to apply to the animation (default is linear).

Returns

Task<bool>

A Task representing the asynchronous operation. Returns true if the animation completes successfully; false otherwise.