hunar4321 / particle-life

A simple program to simulate artificial life using attraction/reuplsion forces between many particles
MIT License
2.93k stars 291 forks source link

[particle_life.html] Use CSS for canvas Background color. #51

Closed AnasQiblawi closed 1 year ago

AnasQiblawi commented 1 year ago

I was thinking about this for a while 😅

How about we just define the color in CSS, Instead of checking and re-drawing the Background color in canvas every time update() is called,

so the script only call it once we change the color.

This way, we might also improve performance a little bit.