Color adjustment of text and headings according to parent section

Hi

I would like to use sections to implement different color areas. For example, one area has a purple background color and the color of the text and headings should be white. The other area has a white background color and the text should be black, headings purple.

Now I can define the background color using different classes on the sections. Can I configure the lower-level text and heading elements in the builder so that their color automatically adapts to the parent section? Or is this best implemented using a CSS stylesheet?

Thank you very much.