I have three integers:
($r, $g, $b) = (255, 128, 0);
I would like to print a string like:
"#FF8000"
using those variables.
How do I do this?
my $rgb = sprintf '#%02X%02X%02X', $r, $g, $b;
See sprintf and printf.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With