# GetColor

> Get a named color value.

## Definition

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

## GetColor(string)

Get a named color value.

```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.0/script-reference/unityengine/color.md) |             |

### Remarks

Many shaders use more than one color. Use GetColor to get the propertyName color.

Common color names used by Unity's builtin shaders:

`"_Color"` is the main color of a material. This can also be accessed via [Material.color](/engine/6000.0/script-reference/unityengine/material/color.md) property.

`"_SpecColor"` is the specular color of a material (used in specular/glossy/vertexlit shaders).

`"_EmissionColor"` is the emissive color of a material (used in vertexlit shaders).

`"_ReflectColor"` is the reflection color of the material (used in reflective shaders).

Additional Resources: [Material.color](/engine/6000.0/script-reference/unityengine/material/color.md) property, [Material.SetColor](/engine/6000.0/script-reference/unityengine/material/setcolor.md), [Shader.PropertyToID](/engine/6000.0/script-reference/unityengine/shader/propertytoid.md).

## GetColor(int)

Get a named color value.

```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.0/script-reference/unityengine/shader/propertytoid.md).

### Returns

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

### Remarks

Many shaders use more than one color. Use GetColor to get the propertyName color.

Common color names used by Unity's builtin shaders:

`"_Color"` is the main color of a material. This can also be accessed via [Material.color](/engine/6000.0/script-reference/unityengine/material/color.md) property.

`"_SpecColor"` is the specular color of a material (used in specular/glossy/vertexlit shaders).

`"_EmissionColor"` is the emissive color of a material (used in vertexlit shaders).

`"_ReflectColor"` is the reflection color of the material (used in reflective shaders).

Additional Resources: [Material.color](/engine/6000.0/script-reference/unityengine/material/color.md) property, [Material.SetColor](/engine/6000.0/script-reference/unityengine/material/setcolor.md), [Shader.PropertyToID](/engine/6000.0/script-reference/unityengine/shader/propertytoid.md).
