I am struggling to find out a way to calculate the amount of times one or multiple figures like squares/rectangles of different colors are intercepted by other squares/recta