colorToRGB: function (color) {
if (color.substr(0, 1) == "#")
color = color.substring(1);
if (color.length != 6)
for (x = 0; x < 3; x++) {
rgb[0] = color.substr(x * 2, 2)
rgb[3] = "0123456789abcdef"; rgb[1] = rgb[0].substr(0, 1)
rgb[2] = rgb[0].substr(1, 1)
rgb[20 + x] = rgb[3].indexOf(rgb[1]) * 16 + rgb[3].indexOf(rgb[2])
}
return 'rgb(' + rgb[20] + ',' + rgb[21] + ',' + rgb[22] + ')';
}
if (color.substr(0, 1) == "#")
color = color.substring(1);
if (color.length != 6)
return '';
color = color.toLowerCase()
var rgb = new Array();for (x = 0; x < 3; x++) {
rgb[0] = color.substr(x * 2, 2)
rgb[3] = "0123456789abcdef"; rgb[1] = rgb[0].substr(0, 1)
rgb[2] = rgb[0].substr(1, 1)
rgb[20 + x] = rgb[3].indexOf(rgb[1]) * 16 + rgb[3].indexOf(rgb[2])
}
return 'rgb(' + rgb[20] + ',' + rgb[21] + ',' + rgb[22] + ')';
}