Nodes/MdColorMod/Primitive Color CMYK (MD)
ComfyUI Node

Primitive Color CMYK (MD)

Give a printer's color and get back a screen color

By MdONeilsl·Created 2 months ago·Updated 2 months ago· 0
Primitive Color CMYK (MD)
    • int
    • HEX
    Cyan0.0
    Magenta0.0
    Yellow0.0
    Key0.0

    CMYK is the color space of ink, not screens - cyan, magenta, yellow and black percentages that describe what a printer lays down. AI work is sRGB through and through, so you'll rarely need this node. But if you're handed a brand palette in CMYK percentages (a shocking number of real-world design specs are), or you just want to see what a print-color looks like on screen, mdPrimitiveColorCMYK converts those four values into a packed RGB integer and a #RRGGBB hex string.

    How it works

    Each of the four inputs is a percentage from 0 to 100. The node normalizes them to 0–1 and applies the classic naive CMYK→RGB formula:

    • R = (1 − Cyan) × (1 − Key)
    • G = (1 − Magenta) × (1 − Key)
    • B = (1 − Yellow) × (1 − Key)

    Then it clamps and packs as (R << 16) | (G << 8) | B, same as the other primitive color nodes here. Note the "Key" input is black - that's the K in CMYK. At all zeros you get white; raise everything toward 100 and you sink toward black.

    The inputs and outputs

    • Cyan / Magenta / Yellow / Key - 0 to 100%, defaults 0.
    • Output int - packed color integer (0–16777215).
    • Output HEX - hex string.

    Install

    Part of the MdColorMod pack, no dependencies, no models:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MdONeilsl/ComfyUI-MdColorMod
    

    Restart ComfyUI, or install via ComfyUI Manager by searching "MdColorMod".

    Where people get burned

    This conversion is the simple, naive CMYK→RGB - the one that ignores ICC profiles and black-generation curves. Real print pipelines do far more, so treat the result as "approximately this color on screen," not a proof. If the color looks off from what you expect, that's inherent to the naive formula, not the node misbehaving. And the usual primitive-color reminder: the int output is a number for color-INT inputs, not a pixel.

    Categorymd/color

    Inputs (4)

    NameTypeDefaultDescription
    CyanFLOAT0.00–100Cyan percentage (0-100%).
    MagentaFLOAT0.00–100Magenta percentage (0-100%).
    YellowFLOAT0.00–100Yellow percentage (0-100%).
    KeyFLOAT0.00–100Key (black) percentage (0-100%).

    Outputs (2)

    NameTypeDescription
    intINTPacked 24-bit integer color value (0-16777215).
    HEXSTRINGHexadecimal color string (e.g., #FF0000).