Skip to main content
1 of 2
Sjoerd Smit
  • 25.7k
  • 51
  • 85

In this situation, the most concise way to do what you want that I can think of is:

With[{part := Part[list, row - 1 ;; row + 1, start ;; start + 2]}, part = Array[color1 &, Most @ Dimensions[part]] ] 

In short, just create a complete array that matches the dimensions of the Part your trying to overwrite. You're trying to overwrite a part of list with dimensions 3x3x3 with a list that has dimensions 3. That's why Mathematica does the assignment at a different level than you expect. The only way out of this is to match the dimensions of the old part and the new one.

Sjoerd Smit
  • 25.7k
  • 51
  • 85