From d68d926a2d5e3e4297fd6fb5d5b531aadc1a26d6 Mon Sep 17 00:00:00 2001 From: Thor Kramer Brigsted Date: Tue, 14 Nov 2017 16:50:28 +0100 Subject: [PATCH] Added color32 support for NodeTint --- Scripts/Node.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Scripts/Node.cs b/Scripts/Node.cs index 9fb9297..b541439 100644 --- a/Scripts/Node.cs +++ b/Scripts/Node.cs @@ -178,9 +178,9 @@ namespace XNode { public class NodeTint : Attribute { public Color color; /// Specify a color for this node type - /// Red [0..1] - /// Green [0..1] - /// Blue [0..1] + /// Red [0.0f .. 1.0f] + /// Green [0.0f .. 1.0f] + /// Blue [0.0f .. 1.0f] public NodeTint(float r, float g, float b) { color = new Color(r, g, b); } @@ -190,6 +190,14 @@ namespace XNode { public NodeTint(string hex) { ColorUtility.TryParseHtmlString(hex, out color); } + + /// Specify a color for this node type + /// Red [0 .. 255] + /// Green [0 .. 255] + /// Blue [0 .. 255] + public NodeTint(byte r, byte g, byte b) { + color = new Color32(r, g, b, byte.MaxValue); + } } [Serializable] private class NodePortDictionary : Dictionary, ISerializationCallbackReceiver {