Nodes/comfyui_bmad_nodes/FromListGet1Color
ComfyUI Node Runs on cloud

FromListGet1Color

Index Into a Palette List

By bmad4ever·Created 3 years ago·Updated 9 months ago· 70
FromListGet1Color
  • list
  • COLOR
index0

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's ToColorList.
  • Zero-based indexes. Index 0 is the first swatch; -1 is 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.

CategoryBmad/Lists/Get1

Inputs (2)

NameTypeDefaultDescription
listCOLOR
indexINT0

Outputs (1)

NameTypeDescription
COLORCOLOR