Nodes/ComfyUI-Minitools/Color to RGB 👻
ComfyUI Node

Color to RGB 👻

From a Color Picker String to Three Separate Numbers

By lepiai·Created 2 years ago·Updated 3 days ago· 9
Color to RGB 👻
    • R
    • G
    • B
    colorDEC

    The companion node for LayerStyle's color picker

    If you use ComfyUI_LayerStyle, its color picker hands you a color as a single string. Color to RGB exists to split that into separate R, G, and B outputs so you can wire each channel into whichever node wants a plain number. The README says it outright: this node was written to sit next to LayerStyle's picker, not to be a general color utility.

    So when do you reach for it? When you're building a workflow where a user picks a color once and you need channel values feeding three different inputs - a background tint, a light color, a border. It's a plumbing node, and that's a compliment; ComfyUI runs on plumbing.

    How it works - the honest version

    Here's the thing worth knowing before you build a workflow on it: the implementation doesn't parse hex or CSS. It takes the input string and slices off its first three characters as R, G, and B. That's the whole trick. list(colorDEC)[:3], padded with empty strings if the input is short.

    That means it's tuned to whatever exact format the LayerStyle picker emits. Feed it something else and it produces garbage without complaining - feed it #ff0000 and you'd get f, f, f back. It's character slicing, not color parsing. Know your source's format and it's fine; assume it's magic and it'll bite you.

    The interface

    • colorDEC (STRING, forceInput) - the color string. You're expected to wire this from another node, not type it.
    • Outputs: R, G, B - all wildcard (*) type, so they'll plug into anything that accepts a number.

    Because the outputs are any-type, they connect freely - which is convenient and also means you can't rely on the graph to catch a mismatch. If you're not sure what your color source actually emits, stick a Show Text node on it first.

    Installing it

    This is one of seven nodes in the ComfyUI-Minitools pack, a small personal toolkit from lepi ai (category "MiniTools", ghost 👻 in the names). No models, no keys - this one is pure string work.

    cd ComfyUI/custom_nodes
    git clone https://github.com/lepiai/ComfyUI-Minitools
    

    then restart. Or ComfyUI Manager → search "ComfyUI-Minitools" → Install → Restart.

    One pack-wide gotcha: the pack loads the LLM node at import time and that module needs the openai package. If it's missing, the entire pack fails to load and this node vanishes too. Manager handles requirements automatically; if you cloned by hand, run pip install -r requirements.txt in ComfyUI's environment first. And keep your expectations calibrated - this is a tiny tool for one specific job, not a color utility suite.

    CategoryMiniTools

    Inputs (1)

    NameTypeDefaultDescription
    colorDECSTRING

    Outputs (3)

    NameTypeDescription
    R*
    G*
    B*