Hitting space will reset everything and generate a random starting color, the rest is automatic. I was messing with code casually and came up with this, it's a pretty fun thing to mess with and I enjoy watching it do its thing. The colors change as the object bounces around and it turns into smaller and smaller particles as it bounces around.
I did some relatively simple coding to get this, maybe check it out in the project, it's really easy to make your own version of this.