Formatted RichTextBox in C#

Color color = System.Drawing.Color.Green;
var lines= richTextBox.Lines;
int index = 0;
foreach (string line in lines)
{
   var start = richTextBox.GetFirstCharIndexFromLine(index);  //Get the 1st char index of a line.
   var length = lines[index].Length;
   richTextBox.Select(start, length); //Select from there to the end
   richTextBox.SelectionColor = color;
   index++;
}