# SetColorKeys(ReadOnlySpan<GradientColorKey>)

> Setup gradient with an array of color keys.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void SetColorKeys(ReadOnlySpan<GradientColorKey> keys)
```

### Parameters

**** (\[ReadOnlySpan\<GradientColorKey>]\(https\://learn.microsoft.com/dotnet/api/system.readonlyspan-1)): Array of color keys.

### Remarks

Note that the color keys will be automatically sorted by time value and that it is ensured to always have a minimum of 2 color keys.
