Extracting Elements from an RGB Value. To extract the settings of the red, green, and blue elements from an RGB value, you can use the following method: Convert the RGB value to a hexadecimal value. This will give you a hexadecimal number with up to six digits. From right to left, each pair of hexadecimal digits is the setting of red, green, and blue, respectively, and can be converted back to decimal.