I think you are looking for ScintillaNET .
On the other hand, if you want to do it yourself in RTB, you can do it by first finding lineNumberusing TextBoxBase.Lines . Then...
//Select the line from it number
startIndex = richTextBox.GetFirstCharIndexFromLine(lineNumber);
richTextBox.Select(startIndex, length);
//Set the selected text fore and background color
richTextBox.SelectionColor = System.Drawing.Color.White;
richTextBox.SelectionBackColor= System.Drawing.Color.Blue;