Determining the background-color or color in numeric format across browsers
<p>I have been through a number of responses to similar questions. I just want to clarify if I am understanding correctly. My purpose is to do some colour calculations.</p>

<p>I have been working in fire fox where:</p>

<pre><code>var bkg_Colour = $("#test_Box_1").css("background-color");  // is red
var fgd_Colour = $("#test_Box_2").css("background-color");  // is blue
</code></pre>

<p>returns rgb(255, 0, 0) and rgb(0, 0, 255) respectively.</p>

<p>Which is fine and I have calculated the distance between the foreground and background appropriately by splitting out the tuples and comparing them.</p>

<p><strong>BUT:</strong></p>

<p>In internet explorer this same code returns "red" and "blue" and of course the calculation fails.</p>

<p>Form the previous answers it appears that there isn't a consistent way of getting the colour back (whether background-color or color) in a numeric format - if using $(...).css. And it appears that all sorts of hoops have to jumped through to cover all the bases.</p>

<p>So is there a way of doing this without using $(...).css?</p>

<p><strong>Edit</strong></p>

<p>Just following this up when I apply the example code given <a href="http://api.jquery.com/css/" rel="nofollow">here</a>  in my script and I run it in FF I get rgb(255,0,0) when I run it in IE i see the word "red" in result. <strong>BUT</strong>
when I run the above link in IE result is rgb(xxx,xx,xx) I am therefore very confused. Is there a server setting or something that is causing IE to behave this way on the page I am serving??</p>

<p><strong>Edit</strong></p>

<p>As far as I can tell at the moment in IE it reports back the colour as specified in the css, namely "green" "blue" "red" or #808080 etc. whereas in ff it always reports it back as a rgb value.</p>
