var
c : Tcolor;
r,g,b: Byte;
s: String;
begin
c:=MojePole[i,j].Brush.Color;
c:=ColorToRGB(c);
r:=getrValue(c);
g:=getgValue(c);
b:=getbValue(c);
s:=(Format('%d',[R])+','+Format('%d',[G])+','+Format('%d',[B]));
//výsledný text zapíšeš do súboru