bgrins / spectrum

The No Hassle JavaScript Colorpicker
https://bgrins.github.io/spectrum/
MIT License
2.32k stars 588 forks source link

Is there option to make Palette visible vertically instead of horizontally #574

Open swaroopg92 opened 3 years ago

swaroopg92 commented 3 years ago

When showSelectionPalette is set true, the Selectionpalette expands horizontally. image But the bottom of this palette is entirely empty and unecessary space, can I make this palette vertical? If yes, how to do so? Any help appreciated. Thanks.

DanielOndiordna commented 3 years ago

To show your palette vertically, you should modify the palette array to an array-of-arrays. From the examples:

 palette: [
        ['black', 'white', 'blanchedalmond',
        'rgb(255, 128, 0);', 'hsv 100 70 50'],
        ['red', 'yellow', 'green', 'blue', 'violet']
    ]