title: Casting a RGB string to a Color type
body: <p>I am reading from a file that has a list of RGB values, i.e.</p>
  
  <pre><code>0,1,6
  0,2,6
  0,43,170
  0,42,168
  0,44,175
  0,44,176
  0,44,176
  0,221,255
  0,222,255
  0,222,255
  </code></pre>
  
  <p>I have stored all these values into a <code>string[]</code> array, with this constructor:</p>
  
  <pre><code>    public Program(int rows, String fileLocation) {
  
          int i;
          String line;
          count = 0;
          this.rows = rows;
          this.fileLocation = fileLocation;
          stringArray = new String[rows];
  
          try {
              System.IO.StreamReader file = new System.IO.StreamReader(fileLocation);
              for (i = 0; i &lt; rows; i++) {
                  while ((line = file.ReadLine()) != null) {
                      stringArray[i] = line;
                      count++;
                      break;
                  }
              }
          }
          catch (Exception e) {
              throw (e);
          }
      }
  </code></pre>
  
  <p>I wanted to convert these current <code>String</code>s to <code>Color</code> values, as they are just RGB values in the form of Strings.</p>
  
  <p>So I used this method:</p>
  
  <pre><code>    public Color[] convertToColorArray() {
          for (int i = 0; i &lt; rows; i++) {
              colorArray[i] = System.Drawing.Color.FromArgb(stringArray[i]);
          }
          return colorArray;
      }
  </code></pre>
  
  <p>With that said, I am getting the following error:</p>
  
  <p><img src="https://i.stack.imgur.com/rGHNA.png" alt="enter image description here"></p>
  
  <p>Telling me I have an invalid arg. I understand that the argument is not necessarily something like this <code>255,255,255</code> which are three <code>ints</code> separated by commas, but my <code>string</code> input is in that format. What is it I should do? Should I cast it to something? Should I simply store those values into a <code>Color[]</code> in my constructor in the beginning?</p>