Close color picker on 'Enter'. Code Clean up

Close the color picker, when the input field is in focus, and the 'enter' key is pressed.
Small code clean up for detect key types from ``` $ui.keyCode ```