Simplifed getHexColor styling.
Ported from jQuery.

Now using vanilla javascript.