Color From Hex
A color from a hexadecimal color string.
Node id color/from-hex
The Color From Hex node creates a color from a hex code, such as #ff0000,
#f00, or #ff000080.
Inputs
| Name | Type | Default | Notes |
|---|---|---|---|
| hex | string | "#000000" |
Outputs
| Name | Type | Notes |
|---|---|---|
| color | Color |
Behaviour
- Formats. Parses 3, 4, 6, and 8 digit hex strings (
#RGB,#RGBA,#RRGGBB,#RRGGBBAA), with or without a leading#. - Case-insensitive. Upper and lower case letters (
#FF0000or#ff0000) work identically. - Opacity. 4-digit and 8-digit codes set the alpha channel (e.g.
#80or#8maps to ~0.5 opacity). 3-digit and 6-digit codes default to opaque (1.0). - Default. Default input is
#000000(opaque black). - Fallback. Invalid, empty, or unrecognized hex inputs fall back gracefully
to opaque black (
#000000).
Related nodes
- Color To Hex: the reverse operation, writing a color as
#rrggbb. - Color From HSL: a color from HSL values.