TGraphicColor Error lazarus / 39-Graphics ---------------------------------------------------------------------- PeterATC · 2013-06-30 03:48 HI I am declaring a constant PossibleColors : Array [0..MAX_COLORS-1] of TColor = (clRed, clBlue, clYellow); I then declare a variable ColorOfBricks : array [0..MAX_COLUMNS, 0..MAX_ROWS] of TColor; I then have the below code to assign the colors to random bricks procedure AssignBrickColors; var    i, j : integer; begin   for i := 0 to frmMain.drwGrid.ColCount-1 do;       for j := 0 to frmMain.drwGrid.RowCount - 1 do;       ColorOfBricks[j] := PossibleColors(random(MAX_COLORS)); end;        but the code fails at the "PossibleColors" asssignment with the following error unit1.pas(50,30) Error: Incompatible types: got "Array[0..2] Of TGraphicsColor" expected "TGraphicsColor" any help would be appreciated. ---------------------------------------------------------------------- Leledumbo · 2013-06-30 05:47 ColorOfBricks is a two dimensional array, while PossibleColors is one dimensional. Perhaps you mean: Code: [Select]procedure AssignBrickColors; var    i, j : integer; begin   for i := 0 to frmMain.drwGrid.ColCount-1 do       for j := 0 to frmMain.drwGrid.RowCount - 1 do           ColorOfBricks[i,j] := PossibleColors[random(MAX_COLORS)]; end; Note that you also have some syntax/semantic errors which I've fixed above ---------------------------------------------------------------------- PeterATC · 2013-06-30 12:55 Thanks. The [] brackets at the PossibleColors was the problem.