Odin has a dedicated attribute overview with examples

GUIColorAttribute class

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector.Attributes
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.Delegate | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter | AttributeTargets.All, AllowMultiple = false, Inherited = true)]
public class GUIColorAttribute : Attribute, _Attribute

GUIColor is used on any property and changes the GUI color used to draw the property.

  • System.Object
  • System.Attribute
  • GUIColorAttribute

The following example shows how GUIColor is used on a properties to create a rainbow effect.

public class MyComponent : MonoBehaviour
	[GUIColor(1f, 0f, 0f)]
	public int A;

	[GUIColor(1f, 0.5f, 0f, 0.2f)]
	public int B;

	public int C;

	private Color GetColor() { return this.A == 0 ? : Color.white; }


GUIColorAttribute(Single, Single, Single, Single)
Sets the GUI color for the property.
public GUIColorAttribute(float r, float g, float b, float a = 1F)
System.Single r

The red channel.

System.Single g

The green channel.

System.Single b

The blue channel.

System.Single a

The alpha channel.

Sets the GUI color for the property.
public GUIColorAttribute(string getColor)
System.String getColor

Specify the name of a local field, member or property that returns a Color.


The GUI color of the property.
public Color Color
The name of a local field, member or property that returns a Color. Both static and instance methods are supported.
public string GetColor

This website is brand new and built with the Odin 2.1 beta in mind. This means you might discover some features such as attribute expressions that are only available in the beta.

You can download the 2.1 beta from here and read the patch-notes here.