Assign foreground color property to a string dynamically
<p>I have a label and i assigned foreground color to it dynamically using the following code:</p>

<pre><code>string xCol = "#F8951D";
Color c = System.Drawing.ColorTranslator.FromHtml(xCol);
string abc = Convert.ToString(c);
string[] col = abc.Split();
for (int k = 1; k &lt;= 4; k++)
{
    col[k] = col[k].Replace("A", "");
    col[k] = col[k].Replace("=", "");
    col[k] = col[k].Replace("[", "");
    col[k] = col[k].Replace(",", "");
    col[k] = col[k].Replace("R", "");
    col[k] = col[k].Replace("G", "");
    col[k] = col[k].Replace("B", "");
    col[k] = col[k].Replace("]", "");
    if (k == 1)
    { int abc1 = Convert.ToInt32(col[k]); Session["abc1"] = abc1; }
    else if (k == 2)
    { int abc2 = Convert.ToInt32(col[k]); Session["abc2"] = abc2; }
    else if (k == 3)
    { int abc3 = Convert.ToInt32(col[k]); Session["abc3"] = abc3; }
    else if (k == 4)
    { int abc4 = Convert.ToInt32(col[k]); Session["abc4"] = abc4; }
}

int c1 = Convert.ToInt32(Session["abc1"].ToString());
int c2 = Convert.ToInt32(Session["abc2"].ToString());
int c3 = Convert.ToInt32(Session["abc3"].ToString());
int c4 = Convert.ToInt32(Session["abc4"].ToString());
lblDept.ForeColor = Color.FromArgb(c1,c2,c3,c4);
</code></pre>

<p>How can I assign a foreground color property to a string dynamically using <code>a,r,g,b</code> components?</p>

<p>Is it possible to assign it using <code>string strColor = Color.FromArgb(c1,c2,c3,c4);</code>?<br>
How can I set a color property to a string dynamically?</p>
