Move the SolidBrush definition outside any method, so it becomes part of the class (you should do this anyway, as all Graphics objects are scarce resources and need to be Disposed correctly when you are finished with them - if you don't you will get problems as they run out).
The class then persists the value for you.
When you detect it hit the wall, Dispose the existing instance, and create a new SolidBrush using a random colour:
How to choose a random color from System.Drawing.Color?[
^]