Nodes/Pixel Palette Art/Create Color From RGB
ComfyUI Node

Create Color From RGB

Where every palette in this pack starts

By ranska·Created about a year ago·Updated 7 months ago· 1
Create Color From RGB
    • color
    red255
    green0
    blue0
    color_name

    Create Color From RGB is the front door of the Pixel Palette Art pack. Nearly every palette in this ecosystem starts here: you take three sliders, type an optional name, and out pops a PIXEL_COLOR - the custom object type every other node in the pack consumes. Without it you're stuck, because there's no way to type #ff8000 directly into the pack's other nodes. A color has to be built first.

    The odd thing about it, and the thing to internalize, is that you can't see anything when you run it. PIXEL_COLOR is an in-memory Python object, not an image, so this node produces data you can't look at until you wire it into Color to image (a rendered swatch), Mix Colors, or Create Gradient Palette. That's normal for this pack - think of it as defining a variable, not generating output.

    How it works

    The node constructs a PixelColor(r, g, b, name) and clamps all channels to 0–255. That's it - there's no hidden math. The real magic is downstream: the color object carries an exporter that can emit hex, rgb, hsl, CSS, and GIMP text, and it can be mixed or interpolated in RGB or HSV by the other nodes. Your color_name, if you set one, travels along - it shows up in GIMP exports as the color's name and in Palette View labels, so naming your colors is worth the two seconds. The css text format even derives its variable name from it.

    A note for the workflow-fussy: the color_space field on the object defaults to rgb, but nodes like Mix Colors and Create Gradient Palette switch it to hsv internally via a context manager, so you don't need to think about it here.

    Inputs and outputs

    Three required INTs, each 0–255:

    • red (default 255), green (default 0), blue (default 0) - the default is literally pure red.

    One optional STRING: color_name, empty by default.

    Output is a single color of type PIXEL_COLOR. That's the only output, and it feeds every color-taking input in the pack.

    Installing

    Part of the Pixel Palette Art pack - install the pack once and all sixteen nodes come along. ComfyUI Manager → search "Pixel Palette Art", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ranska/pixel_palette_art.git
    

    Restart ComfyUI; the node is under pixel_art/colors. The only dependency is Pillow, already present in ComfyUI. No models, no weights, nothing to download.

    Common issues

    The #1 confusion is expecting a visible result. You won't see anything until something downstream renders the color. Wire it into Color to image and you'll instantly get a labeled swatch.

    Second: there's no hex input here. If you have a hex code, you'll either convert it yourself (divide channels by hand, or use any hex-to-rgb tool) or - for palettes rather than single colors - skip straight to the GIMP Palette Loader, which parses .gpl files that are full of hex-ish entries. And one small trap when comparing colors: a red 255,0,0 and a near-red 254,0,0 are different PIXEL_COLOR objects, so expect "duplicates" in Sort/Append results if you weren't careful about exact values.

    Categorypixel_art/colors

    Inputs (4)

    NameTypeDefaultDescription
    redINT2550–255Composante rouge (0-255)
    greenINT00–255Composante verte (0-255)
    blueINT00–255Composante bleue (0-255)
    color_nameoptSTRINGNom optionnel de la couleur

    Outputs (1)

    NameTypeDescription
    colorPIXEL_COLOR