using System; using UnityEngine; namespace XNode { [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class NodeTintAttribute : Attribute { public Color color; /// Specify a color for this node type /// Red [0.0f .. 1.0f] /// Green [0.0f .. 1.0f] /// Blue [0.0f .. 1.0f] public NodeTintAttribute(float r, float g, float b) { color = new Color(r, g, b); } /// Specify a color for this node type /// HEX color value public NodeTintAttribute(string hex) { ColorUtility.TryParseHtmlString(hex, out color); } /// Specify a color for this node type /// Red [0 .. 255] /// Green [0 .. 255] /// Blue [0 .. 255] public NodeTintAttribute(byte r, byte g, byte b) { color = new Color32(r, g, b, byte.MaxValue); } } }