# GetColor

> Get a color from the property block.

## Definition

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

## GetColor(string)

Get a color from the property block.

```csharp
public Color GetColor(string name)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the property.

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [Color](/engine/6000.7/script-reference/unityengine/color.md) |             |

### Remarks

Returns (0, 0, 0, 0) if not found. If the value is previously set using [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md), the returned value is converted from the currently active color space back to the sRGB color space.

Additional Resources: [MaterialPropertyBlock.GetVector](/engine/6000.7/script-reference/unityengine/materialpropertyblock/getvector.md), [MaterialPropertyBlock.SetVector](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setvector.md), [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md).

## GetColor(int)

Get a color from the property block.

```csharp
public Color GetColor(int nameID)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The name ID of the property retrieved by [Shader.PropertyToID](/engine/6000.7/script-reference/unityengine/shader/propertytoid.md).

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [Color](/engine/6000.7/script-reference/unityengine/color.md) |             |

### Remarks

Returns (0, 0, 0, 0) if not found. If the value is previously set using [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md), the returned value is converted from the currently active color space back to the sRGB color space.

Additional Resources: [MaterialPropertyBlock.GetVector](/engine/6000.7/script-reference/unityengine/materialpropertyblock/getvector.md), [MaterialPropertyBlock.SetVector](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setvector.md), [MaterialPropertyBlock.SetColor](/engine/6000.7/script-reference/unityengine/materialpropertyblock/setcolor.md).
