But you can always store the colors in a separate 2D array that you use like this:
var
CellColors: array of TColor;
//...
// call this after the cell count of the grid is known.
SetLength(CellColors, StringGrid1.ColCount, StringGrid1.RowCount);
CellColors[0,0] := clRed;
CellColors[0,1] := clBlue;
// etc.
procedure TForm1.StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
aState: TGridDrawState);
begin
StringGrid1.Canvas.Brush.Color := CellColors[aCol, aRow];
end;