$("#colorpicker").spectrum({
color: "white",
showInput: true,
className: "full-spectrum",
showInitial: true,
showPalette: true,
showSelectionPalette: true,
maxSelectionSize: 10,
preferredFormat: "hex",
localStorageKey: "spectrum.demo",
clickoutFiresChange: true,
palette: [["transparent"]],
change: function(color) {
if(color._originalInput.a === 0) {
color = "transparent";
}else {color = color.toHexString();}
$(this).val(color );
}
This is my solution which worked to check whether color selected is transparent or not. Since we can not convert the transparent value to hexstring , we need to manually check for transparent as string .