hex to rgb
This block is part of the value group and was last modified in core v12.0.6.
hex to rgb v12.0.6 Converts a hex color code into rgb/a
- hex required
valueHex color code to convert. Accepts: rgb, #rgb, rrggbb, #rrggbb, rrggbbaa, #rrggbbaa
- success
condition - rgb
valueReturns the color code in the following format: rgb()
- rgba
valueReturns the color code in the following format: rgba()
- rgba
arrayReturns the color code in the following format: [r, g, b, a]
Strips ALL non-hex characters first (# may appear anywhere), then requires exactly 3, 4, 6 or 8 hex digits (4/8 carry alpha). Alpha is emitted as a 0-1 float rounded to 2 decimals (default 1). On any other digit count condition is false and rgb/rgba/array are NOT written. Example: "#0F08" -> rgba(0,255,0,0.53).
A typical wiring for hex to rgb: value feeds the value pin; the condition out pin feeds branch.

Version history
Introduced in v12.0.6.
Back to
value Return to the main group to view all sub-groups Back to value Return to the group to view all blocks within this group
