How do I convert an integer to a javascript color?
<p>I have an integer which I need to convert to a color in javascript.
I am using an MVC model and am trying to replicate a model in a software for a web interface. 
I have the color in integer format from the database. It needs to be converted to a color in javascript.</p>

<p>For example: integers like -12525360, -5952982</p>

<p>I have the code like this :</p>

<pre><code>items[x].barStyle = "stroke: Black; fill = Red";
</code></pre>

<p>So instead of giving the fill:Red, I need to give it the exact color corresponding to the integer value.</p>

<p>This is the code I have written in C#. I need the same thing in javascript.
Here resourcecolor= the integer input.</p>

<pre><code>     var bytes = BitConverter.GetBytes(resourcecolor);
     ti.color = Color.FromArgb(bytes[3], bytes[2], bytes[1], bytes[0]);
</code></pre>
