improve colorPalette() method for handling multiple jQuery elements