I have the following code.
function rgb2hex(rgb) {
rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]);
}
Seems to work ok in FF and Chrome. IE comes up with '1' is null or not an object. rgb value does seem to make it to the rgb.match.
Any ideas?
Thx