OKLCH
The quiet node that packs a color into a single wire
- o
OKLCH is the boring half of the comfyui-oklch-color-picker pack, and it's supposed to be. It doesn't render anything, name anything, or decide anything. It takes three numbers - l, c, h - and bundles them into one TUPLE so the pack's other node, OKLCHPicker, can accept a color endpoint on a single wire instead of three loose ones. That's the whole job, and it does it without a single opinion.
But you can't use it without knowing what those three numbers mean, and that's where the real value sits.
OKLCH is a color space built on Björn Ottosson's OKLab (2020): L is perceptual lightness from 0 (black) to 1 (white), C is chroma - how much actual color is in it - and H is hue in degrees, the thing you'd normally call the color itself. What makes it worth caring about for generation work is that it's roughly perceptually uniform: a small step in a coordinate is about the same visual step no matter where you are in the space. That's exactly why the pack interpolates gradients in OKLCH instead of RGB - same reason it exists at all, and why OKLCHPicker's ramps don't turn to mud in the middle.
The node itself is three FLOAT widgets with sensible ranges baked in: l goes 0 to 1 in 0.001 steps, h goes 0 to 360 in 1-degree steps, and c tops out at 0.4. That chroma ceiling is deliberate - sRGB can't display chroma much past about 0.37, so 0.4 covers everything a monitor can actually show. Push past the gamut and the conversion just clamps; that's physics, not a bug. Output is one TUPLE holding (l, c, h) in that exact order.
In ComfyUI terms this is a value node, the same plumbing family as the built-in primitives: one source, many consumers. You can wire the same tuple to several places, and if you want L/C/H driven from elsewhere in the graph, right-click and Convert widget to input to turn each widget into a socket. It's glue, and it behaves like glue.
One neat trick worth knowing: OKLCHPicker needs both a start and an end point, even if you only care about one color. Make the two OKLCH nodes identical and the gradient is a flat swatch - which is exactly how you use this pack to get a single named color rather than a ramp.
Install is covered in the OKLCHPicker article, since both nodes ship together and install at the same time. There's nothing here that can really break - it's three floats in a box. If something downstream complains about a malformed TUPLE, it's almost always a wiring mixup: this pack's tuples are exactly L, C, H floats, in that order, and nothing else.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| l | FLOAT | 0–1 | — |
| c | FLOAT | 0–0.4 | — |
| h | FLOAT | 0–360 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| o | TUPLE | — |