# colorSpace

> Indicates the color space that the gradient color keys are using.

## Definition

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

```csharp
public ColorSpace colorSpace { get; set; }
```

### Remarks

Color space setting is automatically set up by the gradient editor, based on [GradientUsageAttribute.colorSpace](/engine/6000.0/script-reference/unityengine/gradientusageattribute/colorspace.md) value.

If you are creating gradients from C# code, this value needs to be set manually. Default value assumes that [Gradient.colorKeys](/engine/6000.0/script-reference/unityengine/gradient/colorkeys.md) are expressed in [ColorSpace.Gamma](/engine/6000.0/script-reference/unityengine/colorspace/gamma.md) sRGB. Set this to [ColorSpace.Linear](/engine/6000.0/script-reference/unityengine/colorspace/linear.md) if color keys are expressed as linear values.

Currently only the [GradientMode.PerceptualBlend](/engine/6000.0/script-reference/unityengine/gradientmode/perceptualblend.md) mode needs to know the color space; the value is ignored for other modes.
