Reputation: 87
I am trying to display a spectrum color picker but somehow palettes are not displaying properly. Here Is the code
<input id="color">
<button ng-click="displayColorPicker()">Apply Spectrum </button>
// Angular js code
function displayColorPicker() {
$('#color').spectrum({ // It successfully loaded but UI is broken
showPalette: true,
palette: [
['black', 'white', 'blanchedalmond'],
['rgb(255, 128, 0);', 'hsv 100 70 50', 'lightyellow']
]
});
}
Following are the version details
Jquery: 3.5.0
Spectrum : 1.8.0
Upvotes: 0
Views: 270
Reputation: 1534
I hit the same issue. Seems the repo isn't being maintainted to merge in pull requests.
A workaround is to have an array of arrays containing a single color. Essentially only one column of colors. Like this:
palette: [['white'],['black'],['blue']]
Upvotes: 0