you are right, here is the updated example:
with RichMemo1 do
begin
Clear;
Lines.Add('Line in red');
SetRangeColor(Length(Lines.Text)-Length(Lines[Lines.Count-1])-Lines.Count-1,Length(Lines[Lines.Count-1]),clRed);
Lines.Add('Line in black ');
SetRangeColor(Length(Lines.Text)-Length(Lines[Lines.Count-1])-Lines.Count-1,Length(Lines[Lines.Count-1]),clBlack);
Lines.Add('Line in blue ');
SetRangeColor(Length(Lines.Text)-Length(Lines[Lines.Count-1])-Lines.Count-1,Length(Lines[Lines.Count-1]),clBlue);
Lines.Add('Line in green ');
SetRangeColor(Length(Lines.Text)-Length(Lines[Lines.Count-1])-Lines.Count-1,Length(Lines[Lines.Count-1]),clGreen);
Lines.Add('Line in yellow ');
SetRangeColor(Length(Lines.Text)-Length(Lines[Lines.Count-1])-Lines.Count-1,Length(Lines[Lines.Count-1]),clYellow);
Lines.Add('Normal line.');
Lines.Add('Normal line.');
Lines.Add('Line in gray');
SetRangeColor(Length(Lines.Text)-Length(Lines[Lines.Count-1])-Lines.Count-1,Length(Lines[Lines.Count-1]),clGray);
end;
For Linux you have to modify the line like this:
SetRangeColor(Length(Lines.Text)-Length(Lines[Lines.Count-1])-1,Length(Lines[Lines.Count-1]),clYellow);
And also for the component to compile under Ubuntu you have to replace gtk2richmemo with the one attached.
Anyway, Lazarus really needs an updated component capable of displaying formatted text.