rgb to hex
This block is part of the value group and was last modified in core v12.0.6.
rgb to hex v12.0.6 Converts rgb color codes into hex
- rgba required
valueAccepts the rgba color code in the following format: rgba() or rgb() • Hidden when other fields are filled
- rgba required
arrayAccepts the rgba color code in the following format: [r, g, b, a] • Hidden when other fields are filled
- success
condition - hex
valueReturns the hex color code in the following format: #rrggbb
- hex (opacity)
valueReturns the hex color code in the following format: #rrggbbaa
Prefers the array pin ([r,g,b,a]); otherwise extracts the numbers found in an rgb()/rgba() string. Missing components default to r=0 g=0 b=0 a=1; r/g/b are rounded and clamped to 0-255, alpha is clamped to 0-1. Outputs lowercase "#rrggbb" on value and "#rrggbbaa" on hexopacity; condition is ALWAYS true -- it never signals a parse failure.
A typical wiring for rgb to hex: 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
