Hi there. Using Grasshopper (without any scripting), I have created a series of boxes with random colors. They are laid out in a rectangular matrix so boxes will have up to 8 other boxes next to them, depending on where the boxes are (e.g. boxes at the edge of the matrix will have fewer neighbours). What is the algorithm I need to highlight each box and find out what are the colors of its neighbours?

I’ve tried comparing (Equality) the list of neighbours from a point in the matrix (Closest Points) with the lists generated from each of the color algorithms (the algorithms that assign a color to each box). Theoretically, this should generate a list of coordinates that are common to both and thus identify the color of each neighbour. Assuming that the Equality component compares the coordinates from each list. If not, which command will do that? Or, what is the algorithm I need to do this?

Many thanks in advance.