add option for color automatic selection

Hi! 

I implemented a new option to make the pick-a-color automatically select the color when change it. 

I also did a minor refactoring in updatePreview and created updateInput to centralize these updates. 

However, I did not fix the problem caused by # 47.