Nodes/comfyui_cv/CV Color From Hex
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).

By bmad4ever·Created 3 months ago·Updated 2 days ago· 0
CV Color From Hex
  • color
  • tuple_string
codeCOLOR_RGB2BGR
scale_to_rangefalse
Categoryimage/CV/low-level

Inputs (3)

NameTypeDefaultDescription
colorCOLOR#00ff00Input color in #RRGGBB hex format - renders as a native color picker in the UI.
codeCOMBOCOLOR_RGB2BGRcv2 cvtColor conversion code. 'none (RGB)' passes the sRGB value through unchanged.
scale_to_rangeBOOLEANfalseWhen 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)

NameTypeDescription
tuple_stringSTRINGTuple literal, e.g. '(0, 0, 255)' - feed into draw nodes' colour input.