Primitive Color YCbCr (MD)
Y′CbCr to hex — for the video people in the room
- int
- HEX
Y′CbCr is the color space of video - luma plus two chroma-difference channels, the thing your camera and codecs work in before RGB ever enters the picture. If you've ever worked with broadcast specs, scopes, or a video color pipeline, you've seen values like these. mdPrimitiveColorYCbCr converts a Y′CbCr triple into a packed RGB integer and a #RRGGBB hex string, which is a niche but genuinely handy thing when a video spec hands you color values and you want them as a hex code in your ComfyUI graph.
How it works
The inputs are Luma plus the two chroma differences:
Luma- brightness, 0 to 1.BlueDiff(Cb) - the blue minus luma difference, −0.5 to 0.5.RedDiff(Cr) - the red minus luma difference, −0.5 to 0.5.
The node applies the standard Y′CbCr→RGB matrix (R = Y + 1.402·Cr, and so on), clamps, and packs the result as (R << 16) | (G << 8) | B. All zeros gives you black; a Luma of 1 with both chroma differences at 0 gives white. Same int-and-hex output contract as the other primitive color nodes in the pack.
The inputs and outputs
Luma- 0 to 1, default 0.BlueDiff- −0.5 to 0.5, default 0.RedDiff- −0.5 to 0.5, default 0.- Output
int- packed color integer (0–16777215). - Output
HEX- hex string.
Install
Part of the MdColorMod pack - no dependencies, no model files:
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
The main surprise is the ranges. Cb and Cr go negative, so don't expect the friendly 0–100 percentages of the HSL/HSV siblings - this is a 0-to-1 with signed chroma space, and a value that "looks like 0.5" is a huge chroma shift, not a mild one. Also, this is the standard SD/HD matrix, not the full-range Rec.709 variant some specs use, so a video spec's exact black and white points may not land exactly on 0 and 255. If you're just trying to pick a nice color, walk away from this node - the RGB or HSL primitives are the human-facing ones. This one is for when a spec tells you the numbers.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Luma | FLOAT | 0.0000–1 | Luma (brightness) component (0-1). |
| BlueDiff | FLOAT | 0.000-0.5–0.5 | Blue chroma difference component (-0.5 to 0.5). |
| RedDiff | FLOAT | 0.000-0.5–0.5 | Red chroma difference component (-0.5 to 0.5). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| int | INT | Packed 24-bit integer color value (0-16777215). |
| HEX | STRING | Hexadecimal color string (e.g., #FF0000). |