Skip to content

Commit c3b3a1d

Browse files
Add support for node accent colors
1 parent 755d999 commit c3b3a1d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Assets/com.alelievr.NodeGraphProcessor/Editor/Views/BaseNodeView.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,15 @@ void InitializeView()
155155
mainContainer.Add(debugContainer);
156156

157157
title = (string.IsNullOrEmpty(nodeTarget.name)) ? nodeTarget.GetType().Name : nodeTarget.name;
158+
159+
// Apply node accent color
160+
if (nodeTarget.color.a > 0)
161+
{
162+
titleContainer.style.borderBottomColor = new StyleColor(nodeTarget.color);
163+
titleContainer.style.borderBottomWidth = new StyleFloat(5f);
164+
}
158165

159-
initializing = true;
166+
initializing = true;
160167

161168
SetPosition(nodeTarget.position);
162169

Assets/com.alelievr.NodeGraphProcessor/Runtime/Elements/BaseNode.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ public abstract class BaseNode
1919
/// </summary>
2020
/// <returns></returns>
2121
public virtual string name => GetType().Name;
22-
22+
23+
/// <summary>
24+
/// The accent color of the node
25+
/// </summary>
26+
public virtual Color color => Color.clear;
27+
2328
/// <summary>
2429
/// Set a custom uss file for the node. We use a Resources.Load to get the stylesheet so be sure to put the correct resources path
2530
/// https://docs.unity3d.com/ScriptReference/Resources.Load.html

0 commit comments

Comments
 (0)