GUIColorAttribute

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

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

Requirements

Namespace: Sirenix.OdinInspector
Assembly: Sirenix.OdinInspector
Version: 1.0.5.0

Constructors

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

Properties

Return Type Definition Description
Color Color The GUI color of the property.

Example

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

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

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

	[HideLabel]
	[GUIColor(1f, 1f, 0f)]
	public int C;

	[HideLabel]
	[GUIColor(0f, 1f, 0f)]
	public int D;

	[HideLabel]
	[GUIColor(0f, 1f, 1f)]
	public int E;

	[HideLabel]
	[GUIColor(0f, 0f, 1f)]
	public int F;
	
	[HideLabel]
	[GUIColor(1f, 0f, 1f)]
	public int G;
}