the secret life of triangle medians & hexagon sides

The three white dots are the vertices of a triangle whose medians are drawn. A square is erected on each of the legs of the triangle and the outer vertices of the squares are joined by colored segments as shown. Explore the relationship between these colored segments and the medians of the triangle by dragging the white dots. Can you explain this behavior?
Adapted from the the Stanford Mathematics Problem Book