Hello Vipul Rajan,
You may be able to write an expression for the color of the Square on Grid 2.
Here is suggested Pseudocode as I don’t have the project file to reference or try and write the real code for.
var squareOneColorR = R Value of Square One’s Color
var squareOneColorG = G Value of Square One’s Color
var squareOneColorB = B Value of Square One’s Color
var squareOneAlpha = Alpha Value of Square One’s Color
var squareOneSat = Saturation Value of Square One’s Color
Repeat this process for each square on layer one. Then Compute Averages
var squareOneOnLayerTwoR = (squareOneColorR + squareTwoColorR + squareThreeColorR) / n //Where n is the total number of squares you are referencing, in this case three.
That will give you the average for all R Numeric Values of all squares on layer one averaged together and then assign it to the R Field on the Layer 2 Square. Repeat this math for each of the Fields, RGB, Alpha, and Saturation.
If you do the math this way as a JavaScript Expression, the color of Layer Two’s Square should automatically change whenever you adjust the value of any squares on layer 1.
This is of course only workable so long as you can access the individual color values through Expressions. If you send or attach your AE file, I can play around with it on my end and see if I can make workable expression code for you. Good Luck