Spectrum From Master
A working demo of the latest version of spectrum colorpicker
HTML
<link rel="stylesheet" href="http://bgrins.github.com/spectrum/spectrum.css">
<script src="http://bgrins.github.com/spectrum/spectrum.js"></script>
<a href='http://bgrins.github.com/spectrum'><--Spectrum Homepage</a>
<h2>Basic Usage</h2>
<input type='text' class="default" value="rgba(0, 255, 123, 0.65)"/>
<button class="spectrumit">spectrumit</button>
<button class="destroyit">destroyit</button>
<p type='text' class="basic"/>test</p>
<em id='basic-log'></em>
CSS
.full-spectrum .sp-palette {
max-width: 200px;
}
JavaScript
$( ".spectrumit" ).click(function() {
$(".basic").spectrum({
color: $('.default').val(),
flat: true,
showInitial: true,
showInput: true,
allowEmpty: true,
showAlpha: true,
preferredFormat: "hex",
clickoutFiresChange: false,
change: function(color) {
$("#basic-log").text("change called: " + color.toHexString());
}
});
});
$( ".destroyit" ).click(function() {
$(".basic").spectrum("destroy");
});