Blue at (0,0) expands right to (0,1). Then red at (2,2) overwrites blue's new cell: (0,1) changes from blue to red. So the masked grid has blue at (0,0), red at (0,1), black everywhere else except red at (2,2). That is: row 0 = [1,2,0], row 1 = [0,0,0], row 2 = [0,0,2].