ComfyUI Node
CV Color From Hex
Converts a ComfyUI native COLOR hex string (#RRGGBB) to a tuple string literal for OpenCV draw nodes (e.g. '(0, 0, 255)' for blue in BGR). The hex string is parsed as sRGB. Select a cvtColor code to convert to the desired color space, or 'none (RGB)' to keep the RGB values. 'scale_to_range' normalises each channel to [0, 1] using the target format's per-channel maximum (OpenCV's uint8 ranges: H=179 in HSV/HLS, H=255 in HLS_FULL, all other channels 255).
CV Color From Hex
- color
- tuple_string
◄codeCOLOR_RGB2BGR►
◄scale_to_rangefalse►
Categoryimage/CV/low-level
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| color | COLOR | #00ff00 | Input color in #RRGGBB hex format - renders as a native color picker in the UI. |
| code | COMBO | COLOR_RGB2BGR | cv2 cvtColor conversion code. 'none (RGB)' passes the sRGB value through unchanged. |
| scale_to_range | BOOLEAN | false | When enabled, each channel is divided by its uint8 range max (179 for H in HSV/HLS, 255 else) so the tuple lands in [0, 1]. Disabled = raw uint8 values. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tuple_string | STRING | Tuple literal, e.g. '(0, 0, 255)' - feed into draw nodes' colour input. |