Use mousedown instead of click for color change in the palete