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

namespace Sirenix.OdinInspector
[AttributeUsageAttribute((AttributeTargets)32767, AllowMultiple = False, Inherited = True)]
public class GUIColorAttribute : Attribute


Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector


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


Definition Description
GUIColorAttribute(float, float, float, float) Sets the GUI color for the property.
GUIColorAttribute(string) Sets the GUI color for the property.


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; }