Reworked RGB to hex conversions.