Check if the hex value is valid before setting the background color.
Listen on the document object for the mousemove and mouseup events.
Use camel case for the CSS properties.
Small cosmetic changes.
Specified the size of the input elements.
Added some margins to the inputs and selected-color elements.