Code
$(document).ready(function () {
// This function will update the input element based
// on the currently selected color in the picker
var updatePreview = function() {
var color = $(this).chromoselector('getColor');
$(this).css({
'background-color': color.getHexString(),
'color': color.getTextColor().getHexString(),
'text-shadow': '0 1px 0 ' + color.getTextColor().getTextColor().getHexString()
});
};
// The CSS is set here, so that even if
// a user has disabled javascript, it will
// still be possible to edit the color
$('#showcase6').css({
border: '5px ridge gray',
cursor: 'pointer',
height: '25px',
width: '25px',
'text-indent': '25px',
padding: 0
}).chromoselector({ // Initialise the picker
create: updatePreview,
update: updatePreview,
preview: false,
roundcorners: false
});
});