# GetColors

> Gets the vertex colors of the Mesh.

## Definition

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

## GetColors(List\<Color>)

Gets the vertex colors of the Mesh.

```csharp
public void GetColors(List<Color> colors)
```

### Parameters

**** (\[List\<Color>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): A list of vertex colors to populate.

### Remarks

The color at each index corresponds to the vertex with the same index.

Use this method instead of [Mesh.colors](/engine/6000.7/script-reference/unityengine/mesh/colors.md) or [Mesh.colors32](/engine/6000.7/script-reference/unityengine/mesh/colors32.md) if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access.

Additional Resources: [Mesh.AcquireReadOnlyMeshData](/engine/6000.7/script-reference/unityengine/mesh/acquirereadonlymeshdata.md) function.

## GetColors(List\<Color32>)

Gets the vertex colors of the Mesh.

```csharp
public void GetColors(List<Color32> colors)
```

### Parameters

**** (\[List\<Color32>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): A list of vertex colors to populate.

### Remarks

The color at each index corresponds to the vertex with the same index.

Use this method instead of [Mesh.colors](/engine/6000.7/script-reference/unityengine/mesh/colors.md) or [Mesh.colors32](/engine/6000.7/script-reference/unityengine/mesh/colors32.md) if you control the life cycle of the list passed in and you want to avoid allocating a new array with every access.

Additional Resources: [Mesh.AcquireReadOnlyMeshData](/engine/6000.7/script-reference/unityengine/mesh/acquirereadonlymeshdata.md) function.
