Check out more examples at jscolor.com!

function update(jscolor) { // 'jscolor' instance can be used as a string document.getElementById('rect').style.background-color = '#' + jscolor }