> For the complete documentation index, see [llms.txt](https://espergames.gitbook.io/animatables/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://espergames.gitbook.io/animatables/scripting-basics/creating-animations/animating-colors.md).

# Animating Colors

Color animation scripting example.

## Color AB

```csharp
public class ColorAnimationTest : MonoBehaviour
{
    private Color color;

    private void Start()
    {
        // Animate a color from white to black in 1 second
        AnimationCreator.ColorAnimation(Color.white, Color.black, (x) => color = x, 1);
    }
}
```

## Color Array

```csharp
public class ColorAnimationTest : MonoBehaviour
{
    private Color color;

    private void Start()
    {
        // Animate through all colors in 1 second
        AnimationCreator.ColorAnimation(new Color[] { Color.white, Color.black, Color.red }, (x) => color = x, 1);
    }
}
```
