dbrizov / NaughtyAttributes

Attribute Extensions for Unity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Request] Colouring variables in the inspector

TheEmbracedOne opened this issue · comments

This is a "nice to have" and I'm not sure if this is possible with other tools, but it'd be great if I could somehow colour variables for the inspector either via rgb or hex values:

public class NaughtyComponent : MonoBehaviour {    
    [Color("#123456")]
    public string thisIsAVariable;

    [Color("255,0,102")]
    public Vector3 vectorXYZ;
}

would make:
Example
(there's a tool I use that colours the transform values similarly, it colours the field not just the variable's name, but that's also fine)

Thank you for your consideration.

Not exactly related to this issue, but here is one that can co-op with NaughtyAttributes

// work with NaughtyAttributes
[RichLabel("<color=lime><label/>")]
// A little hack to make NaughtyAttributes render an empty label to avoid overlap
[NaughtyAttributes.ResizableTextArea, NaughtyAttributes.Label(" ")]
public string thisIsAVariable;

// work alone
[RichLabel("<color=#ff0066><label/>")]
public Vector3 vectorXYZ;

// work with Unity's built-in attributes
[RichLabel("<color=pink><label/>")]
[Range(0, 1)]
public float range;

image