var color = new RGBColor(s);
var max = Math.max(color.r, color.g);
max = Math.max(max, color.b);
var scale = 1.0 / max;
function isThatAColor(s) {
if (color.ok) {
document.getElementById('result').style.backgroundColor = 'rgb(' + color.r + ', ' + color.g + ', ' + color.b + ')';
document.getElementById('result-text').innerHTML = 'Red: ' + color.r + ', Green: ' + color.g + ', Blue: ' + color.b
+ '<br />' + color.toRGB() + ', Hex: ' + color.toHex();
alert("Vermelho: " + color.r + "\n" + "Verde: " + color.g + "\n" + "Azul: " + color.b);
}
else {
document.getElementById('result-text').innerHTML = 'Essa cor não existe na livraria, se pretender adicionar uma nova cor visite a livraria "RGB.js".';
document.getElementById('result').style.backgroundColor = 'rgb(255, 255, 255)';
}
};
$(function () {
var perShapeGradient = {
x1: 0.3,
y1: 0,
x2: 0,
y2: 0
};
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column',
backgroundColor: "#E0E0E0",
borderRadius: 0
},
title: {
text: ''
},
xAxis: {
gridLineWidth: 0,
categories: ['JULY 31, 2010', 'JULY 31, 2011', 'JULY 31, 2012']
},
yAxis: {
gridLineWidth: 0.2,
gridLineColor: '#000',
tickInterval: 100,
min: 0,
max: 400,
title: {
text: ''
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
align: 'center',
x: 0,
verticalAlign: 'bottom',
y: 13,
floating: true,
borderColor: '#CCC',
borderWidth: 0,
shadow: false
},
tooltip: {
formatter: function () {
return '<b>' + this.x + '</b><br/>' +
this.series.name + ': ' + this.y + '<br/>' +
'Total: ' + this.point.stackTotal;
}
},
plotOptions: {
series: {
animation: {
duration: 1500
}
},
column: {
borderWidth: 1,
borderColor: '#000',
stacking: 'normal',
dataLabels: { enabled: true, color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white' }
}
},
series: [{
name: 'LONG TERM',
data: [0, 131, 145],
borderRadius: [5, 5, 5, 5]
}, {
name: 'MEDIUM TERM',
data: [0, 48, 54]
}, {
name: 'SHORT TERM',
data: [0, 84, 99]
}],
colors: [
{
linearGradient: perShapeGradient,
stops: [
[0, 'rgb(107, 66, 38)'],
[0.15, 'rgb(232,232,232)'],
[0.30, 'rgb(232,232,232)'],
[0.8, 'rgb(97,97,97)'],
[1, 'rgb(131,139,0)']
]
},
{
linearGradient: perShapeGradient,
stops: [
[0, 'rgb(97, 97, 97)'],
[0.15, 'rgb(232,232,232)'],
[0.30, 'rgb(232,232,232)'],
[0.8, 'rgb(97,97,97)'],
[1, 'rgb(131,139,0)']
]
},
{
linearGradient: perShapeGradient,
stops: [
[0, 'rgb(92,64,51)'],
[0.15, 'rgb(232,232,232)'],
[0.30, 'rgb(232,232,232)'],
[0.8, 'rgb(131,139,0)'],
[1, 'rgb(131,139,0)']
]
}, ]
});
});
});
there...