Skip to content

Commit 8432ebb

Browse files
committed
ADAPT_IMGUI_BUNDLE: Add python specific API for style colors
1 parent d434670 commit 8432ebb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

imgui_node_editor.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ struct Style
225225
float SnapLinkToPinDir; // when true link will start on the line defined by pin direction
226226
ImVec4 Colors[StyleColor_Count];
227227

228+
// [ADAPT_IMGUI_BUNDLE]
229+
#ifdef IMGUI_BUNDLE_PYTHON_API
230+
// python adapter for Style::Colors[StyleColor_Count]
231+
// You can query and modify those values (0 <= idxColor < StyleColor.count)
232+
inline IMGUI_NODE_EDITOR_API ImVec4& Color_(StyleColor idxColor) { IM_ASSERT( (idxColor >=0) && (idxColor < StyleColor_Count)); return Colors[idxColor]; }
233+
inline IMGUI_NODE_EDITOR_API void SetColor_(StyleColor idxColor, ImVec4 color) { IM_ASSERT( (idxColor >=0) && (idxColor < StyleColor_Count)); Colors[idxColor] = color; }
234+
#endif
235+
228236
Style()
229237
{
230238
NodePadding = ImVec4(8, 8, 8, 8);

0 commit comments

Comments
 (0)