Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


colorSpace

Indicates the color space that the gradient color keys are using.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public ColorSpace colorSpace { get; set; }

Remarks

Color space setting is automatically set up by the gradient editor, based on GradientUsageAttribute.colorSpace value.
If you are creating gradients from C# code, this value needs to be set manually. Default value assumes that Gradient.colorKeys are expressed in ColorSpace.Gamma sRGB. Set this to ColorSpace.Linear if color keys are expressed as linear values.
Currently only the GradientMode.PerceptualBlend mode needs to know the color space; the value is ignored for other modes.