Primitive Color CMYK (MD)
Give a printer's color and get back a screen color
- int
- HEX
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.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| Cyan | FLOAT | 0.00–100 | Cyan percentage (0-100%). |
| Magenta | FLOAT | 0.00–100 | Magenta percentage (0-100%). |
| Yellow | FLOAT | 0.00–100 | Yellow percentage (0-100%). |
| Key | FLOAT | 0.00–100 | Key (black) percentage (0-100%). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| int | INT | Packed 24-bit integer color value (0-16777215). |
| HEX | STRING | Hexadecimal color string (e.g., #FF0000). |