FromListGet1Color
Index Into a Palette List
- list
- COLOR
FromListGet1Color grabs a single COLOR from a color list by index. It's the color member of the pack's FromListGet1* family, and it's how you take a palette (built with the pack's color nodes) and select one swatch to feed downstream - a Color Clip, a remap, or a compositing step.
Why you'd reach for it
This pack treats colors as first-class values: Color (RGB) and Color (hexadecimal) make a COLOR, ColorDefaultDictionary/ColorCustomDictionary build palettes, and FindComplementaryColor returns a COLOR. FromListGet1Color is the selector in the middle - you've got a list of candidate colors, you want exactly one, and you may not know which one until runtime.
The classic use is palette iteration: build a color list once, drive the index from a counter or seed, and generate variants that each use a different palette color. Same graph, different swatch, no editing.
How it works
Same lookup as the whole family: index % len(list), zero-based, negative indexes count from the end. The list input is forced - it must come from a node emitting a COLOR list (colors are just RGB tuples in this pack, so a list of them is straightforward). The index widget accepts a connection for dynamic selection. Output is a single COLOR, which wires into any socket expecting a color.
Install
Ships with bmad4ever's pack:
cd ComfyUI/custom_nodes
git clone https://github.com/bmad4ever/comfyui_bmad_nodes
then restart ComfyUI. Manager users search "comfyui_bmad_nodes"; the pack's Python requirements install automatically.
Common issues
- Single color into
list. Won't connect - wrap with the pack'sToColorList. - Zero-based indexes. Index 0 is the first swatch;
-1is the last. - Wrapping. Out-of-range indexes wrap via modulo, so a palette of 6 with index 6 returns swatch 0. Friendly, but be deliberate when iterating.
A one-value selector for a list of colors - nothing more, and that's exactly enough.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| list | COLOR | — | |
| index | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| COLOR | COLOR | — |