ComfyUI Node

Color to RGB

A color is just three numbers — this node hands them to you as integers

By akierson·Created 2 years ago·Updated 2 years ago· 2
Color to RGB
  • color
  • R
  • G
  • B

A color is just three numbers between 0 and 255. Color to RGB is the node that actually hands them to you: you pick a color on a swatch, and out come R, G, and B as separate integer outputs. No typing hex, no mental math.

Why does anyone need this? Because a big slice of ComfyUI speaks in integers. You can feed the R/G/B values into math or logic nodes and make decisions - "if the red channel is high, do X." You can wire them into nodes that build solid-color images or drive a mask threshold. You can compare a color you picked against a color you sampled from an image, or just surface the numbers in a way a human can read and reason about. The COLOR widget world is great for choosing colors; the integer world is where you actually use them. This node is the conversion layer between the two.

The mechanism is exactly what you'd hope: the hex string is parsed pair by pair, so #336699 becomes R=51, G=102, B=153. There's no rounding because the hex digits are the integers - 8-bit color, straight from the source. It's one of those nodes you don't have to think about, which is the point.

Inputs: color (COLOR) - one swatch. Outputs: R, G, B - three separate INT wires, each 0–255. Note that they're three sockets, not one bundle, so you grab the channels you need and leave the rest.

Install. With the rest of the pack: ComfyUI Manager → search "comfyui-colornodes" → install → restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/akierson/comfyui-colornodes

Restart ComfyUI after cloning. The pack has zero extra pip dependencies - PIL, numpy and torch are already part of ComfyUI - and no models to fetch. It's a genuine "clone, restart, done" install.

Troubleshooting. The one thing to keep straight: these are integers on the 0–255 scale, not floats on the 0–1 scale. Some color nodes in other packs output normalized 0–1 values, and if you mix the two you'll get comparisons that are off by a factor of 255 and drive you quietly insane. If your downstream math looks wrong, check what scale it expects first. Also, the outputs are straight conversions of whatever the swatch holds - click the color you mean, because there's no correction happening here.

Simple node, simple job. When you need a color as numbers, this is the one.

Categoryutils/color

Inputs (1)

NameTypeDefaultDescription
colorCOLOR

Outputs (3)

NameTypeDescription
RINT
GINT
BINT