API ReferenceGE Extensionsflowgraphnodesuiimguielemental
ImGui Color
- **Node Name:** `im Color`
Overview
- Node Name:
im Color - Category:
repeat_instant - File:
extensions/flowgraph/nodes/ui/imgui/elemental/imColor.lua
Displays a color picker/editor in an ImGui window. Outputs the selected RGBA color as a table.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
colorIn | color | Initial color value (hidden) |
text | any | Label text for the color picker |
Output Pins
| Pin | Type | Description |
|---|---|---|
colorOut | color | The selected RGBA color as {r, g, b, a} |
Internals
Key Methods
| Method | Description |
|---|---|
_executionStarted() | Initializes the ImGui color array from colorIn (default {1,1,1,1}) |
work() | Draws im.ColorEdit4 and outputs the current color values |
ImGui Flags
Uses ColorEditFlags_NoInputs (no text input boxes) and ColorEditFlags_AlphaBar (shows alpha slider).
How It Works
- On execution start, initializes an ImGui float array from the input color or white default.
- Each frame, draws
im.ColorEdit4with the label and color array. - Outputs the current color as
{r, g, b, a}(0–1 range).
Usage Example
-- Flowgraph:
-- [im Begin] → [im Color (text="Vehicle Color")] → (colorOut) → [Set Paint Color]
-- Under the hood:
local color = im.ArrayFloatByTbl({1, 0, 0, 1}) -- red
im.ColorEdit4("Vehicle Color##42", color, im.flags(im.ColorEditFlags_NoInputs, im.ColorEditFlags_AlphaBar))
-- Output: {color[0], color[1], color[2], color[3]}Key Dependencies
ui_imgui- ImGui bindings (ColorEdit4,ColorEditFlags_*)
See Also
- im Begin (Flowgraph Node) - Related reference
- im Button (Flowgraph Node) - Related reference
- im Checkbox (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide