title: Color a node of treeview with different color
body: <p>I have a <code>treeview</code> with some nodes. Under some condition I want to color each node with different color along with their children. I have written a function that colors node and its children. </p>
  
  <p>Will anyone please let me know is there any possibility that I have <code>Color.Green</code> as a variable such that I wont write the whole function for each color? I mean as an input parameter in function.</p>
  
  <p>Here is the function:</p>
  
  <pre><code>public void ColorChild(TreeNode nodes, int indx)
  {
      foreach (TreeNode node_tmp in nodes.Nodes[indx].Nodes)
      {
         System.Drawing.Color = Green;
         node_tmp.ForeColor = color;
         foreach (TreeNode node_tmp2 in node_tmp.Nodes)
         {
            node_tmp2.ForeColor = Color.Green;
            foreach (TreeNode node_tmp3 in node_tmp2.Nodes)
            {
               node_tmp3.ForeColor = Color.Green;
               foreach (TreeNode node_tmp4 in node_tmp3.Nodes)
               {
                  node_tmp4.ForeColor = Color.Green;
                  foreach (TreeNode node_tmp5 in node_tmp4.Nodes)
                  {
                     node_tmp5.ForeColor = Color.Green;
                  }
               }
            }
        }
     }
  }
  </code></pre>