The first step in the hex to decimal conversion is to get the current back ground colour. We have already seen the document.bgColor property, so that step is easy work, and will be omitted from the next disection of the task.
The bgColor property is stored in a hexidecimal RGB value with the form of "#ABCDEF". The first step is to separate the red, green and blue values. From there, each hexidecimal value can be individually converted from hex to decimal.