You can use an image for this (a solid color jpg for example) or your can change the background color of a component. I recommend changing the background.
See the documentation about color, including several ways to set the background color.
For the random part, you can either make a list of colors and the choose a random item or you can choose a random number (see the Math drawer) and use an if/elseif/else blocks to set the color.
If you get stuck, post a screenshot of the blocks you’ve tried and someone can help you further.
To compliment @muneer’s post, you can assign any element any CSS text color! This demo gives all 134. It also highlights the various color formats accepted!