in reply to Color Converstion

pack/unpack have a few rather strange templates for processing partial bytes, optionally with reversed output, namely 'b', 'B', 'h', and 'H', and one of them comes in handy here. The next appears to work:
my $R = 0xF1; my $G = 0xE2; my $B = 0xD3; my $rgb_int = $R + ($G<<8) + ($B <<16); my $rgb_hex = uc unpack 'H6', pack 'V', $rgb_int; print $rgb_hex;
Result:
F1E2D3
The way it works is by packing the long integer into a 4-byte binary string containing a Little Endian integer (red is first byte); and then unpack the first 3 bytes (= 6 nybbles, a nybble is half a byte) into a hex string, the higher nybble per byte coming first.

"h" swaps order of the nybbles per byte; "B" and "b" respectively do the same in binary, "B" running from the higher to the lower bit, and "b" from low to high.