Padded toHex function with up to six zeroes

This means values aren't too short for use in html and css.