Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    Is this answer better than the existing stackoverflow.com/a/61982880/3124333?
    – SiKing
    Commented Jul 21, 2021 at 22:26
  • I did not see that someone had a similar answer. But in Sil's answer you have to create class for each color you need and as asked in the question, we want to be able to change color randomly. With my answer, you are avec to generate a number randomly in order to change color. Commented Jul 22, 2021 at 9:40