Padded toHex function with up to six zeroes

This means values aren't too short for use in html and css.
Merge pull request #1 from jedateach/master

I've added padding, so that toHex values are always 6 characters long.