mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Added color32 support for NodeTint
This commit is contained in:
parent
5267ac1a30
commit
d68d926a2d
@ -178,9 +178,9 @@ namespace XNode {
|
||||
public class NodeTint : Attribute {
|
||||
public Color color;
|
||||
/// <summary> Specify a color for this node type </summary>
|
||||
/// <param name="r"> Red [0..1] </param>
|
||||
/// <param name="g"> Green [0..1] </param>
|
||||
/// <param name="b"> Blue [0..1] </param>
|
||||
/// <param name="r"> Red [0.0f .. 1.0f] </param>
|
||||
/// <param name="g"> Green [0.0f .. 1.0f] </param>
|
||||
/// <param name="b"> Blue [0.0f .. 1.0f] </param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary> Specify a color for this node type </summary>
|
||||
/// <param name="r"> Red [0 .. 255] </param>
|
||||
/// <param name="g"> Green [0 .. 255] </param>
|
||||
/// <param name="b"> Blue [0 .. 255] </param>
|
||||
public NodeTint(byte r, byte g, byte b) {
|
||||
color = new Color32(r, g, b, byte.MaxValue);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable] private class NodePortDictionary : Dictionary<string, NodePort>, ISerializationCallbackReceiver {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user