getColor: function(idx) { | getColor: function(idx) { | ||||
var el = document.createElement('div'); | var el = document.createElement('div'); | ||||
el.className = 'heatmap-color-' + idx; | el.className = 'heatmap-color-' + idx; | ||||
document.body.appendChild(el); | |||||
return getComputedStyle(el).backgroundColor; | |||||
var color = getComputedStyle(el).backgroundColor; | |||||
document.body.removeChild(el); | |||||
return color; | |||||
} | } | ||||
}, | }, | ||||