You can use the display recorder to animate the movement of a structure during an analysis.
As for the coloring of the elements it will depend on what type of element you are using and if the coloring has been implemented for that element in OpenSees.
You will have to play with the value for the element display option in the display recorder to see if you can get it to change colors. Unfortunately, the different element (and node) display options in OpenSees are not documented anywhere and many elements don’t have the coloring implemented.