magento2 – Add a custom class per page in MainContent

I want to add a custom class in the

The reason I want to do this is because there are certain pages that need a different background color. So suppose a background image is displayed on the homepage, but when I visit it About Us Page I need to convert the image to a background color instead. I'm not sure how to do that. Is it also possible to use the custom variable or something to accomplish this? I mean, I do not know much about Magento and it will be of great help if you teach me the RIGHT way to do it.

PS: I do not have any code to share because I do not know where to start. I think about the default.xml, because I have a custom theme. But I'm not sure how to do it dynamically.