Nodes/ComfyUI/Color Picker
ComfyUI Node Runs on cloud

Color Picker

Pick a color, get a number — for the nodes that want RGB as an int

By Comfy-Org·Created 4 years ago·Updated 20 days ago· 121,575
Color Picker
  • color
  • rgb_int
  • hex

Some nodes want a color as a single number instead of three separate RGB channels or a hex string. That's a weird format to type by hand, which is why Color Picker exists: you click a color swatch, and it hands you both the RGB as an integer and as a hex string. It ships with ComfyUI core, no install, and it's a 2026 addition - a small node that quietly removes an entire class of "how do I write a color as a number" fumbling.

How it works

The input is a COLOR widget - in the UI that's a color picker, so you click, drag, done, no hex memorization required. Under the hood the node reads the hex value and packs it into a single integer the way colors are usually packed in programming: red shifted up two bytes, green one byte, blue in the low byte. So #ff0000 (pure red) becomes 16,711,680, and white is the full 16,777,215. The mapping is r*65536 + g*256 + b.

The color format it expects is #RRGGBB - six hex digits with the hash. The node is strict about that shape, and the error message is just a reminder of the format. If you're feeding it a color from somewhere else, make sure it's a proper hex string, not rgb(255,0,0) or a named color.

Inputs and outputs

One input, color - the color picker widget, default white. Two outputs:

  • rgb_int - the color as a single packed integer (0 to 16,777,215). This is the output that feeds color-as-number nodes.
  • hex - the same color back as its #RRGGBB string, for nodes that want text.

Where people get burned

The most common confusion is expecting the int to be the sum of three separate RGB values - it isn't, it's the packed representation. If a downstream node wanted R, G, B as separate ints, this isn't the converter for that; this is for targets that genuinely want the packed single number.

Second: precision on the hex side. Two different picks can differ by one in the blue channel and it's invisible to the eye but visible to a node doing exact color matching. If you're building a color-matching workflow, copy the exact hex rather than eyeballing - you'll be chasing a one-unit difference forever otherwise.

Third: don't treat the color picker as a palette tool. It picks one color; if your use case needs multiple swatches or a gradient, that's a different kind of node. This one's entire job is the one-color-to-int conversion, done well. It shows up most often in workflows that feed structured color palettes into prompt builders - the kind of model that wants color_palette entries - where a packed int is exactly what the schema wants.

Categoryutilities

Inputs (1)

NameTypeDefaultDescription
colorCOLOR#ffffff

Outputs (2)

NameTypeDescription
rgb_intINT
hexCOLOR