Corrected parsing of hex values

Hex values were being parsed incorrectly because of incorrect indices being used to get substrings into $rHex, $gHex, and $bHex.